[committed] testsuite: Add a -O2 -fgimple testcase next to the -O2 -fno-tree-dse one [PR93820]

Message ID 20200226100048.GT2155@tucnak
State New
Headers show
Series
  • [committed] testsuite: Add a -O2 -fgimple testcase next to the -O2 -fno-tree-dse one [PR93820]
Related show

Commit Message

Jakub Jelinek Feb. 26, 2020, 10 a.m.
Hi!

Based on IRC discussions, I've added another test with __GIMPLE next to the
one with -fno-tree-dse.

2020-02-26  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/93820
	* gcc.dg/pr93820-2.c: New test.


	Jakub

Patch

--- gcc/testsuite/gcc.dg/pr93820-2.c.jj	2020-02-26 10:50:18.796137652 +0100
+++ gcc/testsuite/gcc.dg/pr93820-2.c	2020-02-26 10:51:14.833310929 +0100
@@ -0,0 +1,30 @@ 
+/* PR tree-optimization/93820 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fgimple" } */
+
+typedef int v4si __attribute__((vector_size(4 * sizeof (int))));
+int a[10];
+
+void __GIMPLE (ssa,startwith("store-merging"))
+foo (int *p)
+{
+  int _2;
+  __BB(2):
+  _2 = *p_1(D);
+  a[6] = _2;
+  a[4] = 1;
+  __MEM <v4si> ((int *)&a + _Literal (int *) 16) = _Literal (v4si) { 0, 0, 0, 0 };
+  a[3] = 0;
+  return;
+}
+
+int
+main ()
+{
+  int i = 0;
+  foo (&i);
+  for (i = 0; i < 10; i++)
+    if (a[i])
+      __builtin_abort ();
+  return 0;
+}