summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/20020103-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/20020919-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/graphite/block-1.c11
-rw-r--r--gcc/testsuite/gcc.dg/graphite/block-2.c32
-rw-r--r--gcc/testsuite/gcc.dg/graphite/block-4.c26
-rw-r--r--gcc/testsuite/gcc.dg/graphite/block-5.c26
-rw-r--r--gcc/testsuite/gcc.dg/graphite/block-6.c25
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr37485.c1
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr37684.c2
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr37883.c11
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr37928.c33
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr38073.c9
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr38125.c32
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr38409.c24
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr38413.c14
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr38446.c14
-rw-r--r--gcc/testsuite/gcc.dg/graphite/scop-15.c1
-rw-r--r--gcc/testsuite/gcc.dg/graphite/scop-16.c6
-rw-r--r--gcc/testsuite/gcc.dg/graphite/scop-17.c6
-rw-r--r--gcc/testsuite/gcc.dg/graphite/scop-18.c8
-rw-r--r--gcc/testsuite/gcc.dg/pr34027-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/pr35442.c3
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr38271.c18
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/loop-3.c5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr32044.c55
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-10.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr36630.c1
28 files changed, 361 insertions, 20 deletions
diff --git a/gcc/testsuite/gcc.dg/20020103-1.c b/gcc/testsuite/gcc.dg/20020103-1.c
index 3402e8bdfce..81ffdb1b285 100644
--- a/gcc/testsuite/gcc.dg/20020103-1.c
+++ b/gcc/testsuite/gcc.dg/20020103-1.c
@@ -3,7 +3,7 @@
/* { dg-do compile { target { { i?86-*-* rs6000-*-* alpha*-*-* x86_64-*-* } || { powerpc*-*-* && ilp32 } } } } */
/* { dg-require-effective-target fpic } */
/* { dg-options "-O2 -fpic -fno-omit-frame-pointer -fno-asynchronous-unwind-tables" } */
-/* { dg-final { scan-assembler-not "LC\[0-9\]" { xfail powerpc*-*-* } } } */
+/* { dg-final { scan-assembler-not "LC\[0-9\]" } } */
/* Clobber all call-saved registers that can hold a pointer value. */
#if defined(__i386__)
diff --git a/gcc/testsuite/gcc.dg/20020919-1.c b/gcc/testsuite/gcc.dg/20020919-1.c
index 6b8c5ba7c52..e0fab27020a 100644
--- a/gcc/testsuite/gcc.dg/20020919-1.c
+++ b/gcc/testsuite/gcc.dg/20020919-1.c
@@ -41,7 +41,7 @@
|| defined (__POWERPC__) || defined (PPC) || defined (_IBMR2)
# define REG1 "6"
# define REG2 "7"
-# ifndef __powerpc64__
+# if !defined(__powerpc64__) && !defined(__LP64__)
# define REG3 "8"
# define REG4 "9"
# endif
diff --git a/gcc/testsuite/gcc.dg/graphite/block-1.c b/gcc/testsuite/gcc.dg/graphite/block-1.c
index 039b974fdae..857f8d54e8e 100644
--- a/gcc/testsuite/gcc.dg/graphite/block-1.c
+++ b/gcc/testsuite/gcc.dg/graphite/block-1.c
@@ -2,6 +2,8 @@
#define MAX 8192
+void bar (void);
+
int main()
{
int i, j;
@@ -9,6 +11,8 @@ int main()
int A[MAX * MAX];
int B[MAX * MAX];
+ bar ();
+
for (i = 0; i < MAX; i++)
for (j = 0; j < MAX; j++)
{
@@ -20,6 +24,11 @@ int main()
for (j = 0; j < MAX; j++)
A[i*MAX + j] += B[j*MAX + i];
+ bar ();
+
+ /* FIXME: For now, reductions are not handled by the code generation
+ of graphite. We have to bound the scop to the above loops. */
+
for(i = 0; i < MAX; i++)
for(j = 0; j < MAX; j++)
sum += A[i*MAX + j];
@@ -27,5 +36,5 @@ int main()
return sum;
}
-/* { dg-final { scan-tree-dump-times "Loop blocked" 3 "graphite"} } */
+/* { dg-final { scan-tree-dump-times "Loop blocked" 2 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/block-2.c b/gcc/testsuite/gcc.dg/graphite/block-2.c
new file mode 100644
index 00000000000..cf0969bac1d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/block-2.c
@@ -0,0 +1,32 @@
+/* { dg-options "-O2 -floop-block -fdump-tree-graphite-all" } */
+
+typedef unsigned char UChar;
+typedef int Int32;
+typedef unsigned int UInt32;
+
+void fallbackSort ( UInt32* fmap,
+ UInt32* eclass,
+ Int32 nblock,
+ Int32 verb )
+{
+ Int32 ftab[257];
+ Int32 ftabCopy[256];
+ Int32 H, i, j, k, l, r, cc, cc1;
+ Int32 nNotDone;
+ Int32 nBhtab;
+ UChar* eclass8 = (UChar*)eclass;
+
+ if (verb >= 4)
+ VPrintf0 ( " bucket sorting ...\n" );
+ for (i = 0; i < 257; i++) ftab[i] = 0;
+ for (i = 0; i < nblock; i++) ftab[eclass8[i]]++;
+ for (i = 0; i < 256; i++) ftabCopy[i] = ftab[i];
+ for (i = 1; i < 257; i++) ftab[i] += ftab[i-1];
+
+ for (i = 0; i < nblock; i++) {
+ j = eclass8[i] + ftab [i];
+ }
+ AssertH ( j < 256, 1005 );
+}
+/* { dg-final { scan-tree-dump-times "Loop blocked" 1 "graphite" { xfail *-*-* }} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/block-4.c b/gcc/testsuite/gcc.dg/graphite/block-4.c
new file mode 100644
index 00000000000..4b550b4e472
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/block-4.c
@@ -0,0 +1,26 @@
+/* { dg-options "-O2 -floop-block -fdump-tree-graphite-all" } */
+
+#define N 24
+#define M 1000
+
+float A[1000][1000], B[1000][1000], C[1000][1000];
+
+void test (void)
+{
+ int i, j, k;
+
+ /* These loops contain too few iterations for being strip-mined by 64. */
+ for (i = 0; i < 24; i++)
+ for (j = 0; j < 24; j++)
+ for (k = 0; k < 24; k++)
+ A[i][j] = B[i][k] * C[k][j];
+
+ /* These loops should still be strip mined. */
+ for (i = 0; i < 1000; i++)
+ for (j = 0; j < 1000; j++)
+ for (k = 0; k < 1000; k++)
+ A[i][j] = B[i][k] * C[k][j];
+}
+
+/* { dg-final { scan-tree-dump-times "Strip Mining is not profitable" 2 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/block-5.c b/gcc/testsuite/gcc.dg/graphite/block-5.c
new file mode 100644
index 00000000000..e0bd4688d39
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/block-5.c
@@ -0,0 +1,26 @@
+/* { dg-options "-O2 -floop-block -fdump-tree-graphite-all" } */
+
+#define N 10000
+void foo (int);
+int test ()
+{
+ int a[N][N];
+ int b[N][N];
+ unsigned i, j;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ a[i][j] = i*j;
+
+ for (j = 1; j < N; j++)
+ for (i = 0; i < N; i++)
+ a[i][j] = a[i][j-1] + b[i][j];
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ foo (a[i][j]);
+}
+
+/* Interchange is legal for loops 0 and 1 of the first two SCoPs */
+/* { dg-final { scan-tree-dump-times "Interchange valid for loops 0 and 1:" 2 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/block-6.c b/gcc/testsuite/gcc.dg/graphite/block-6.c
new file mode 100644
index 00000000000..77429f1cb83
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/block-6.c
@@ -0,0 +1,25 @@
+/* { dg-options "-O2 -floop-block -fdump-tree-graphite-all" } */
+
+#define N 10000
+void foo (int);
+int test ()
+{
+ int a[N][N];
+ unsigned i, j;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ a[i][j] = i*j;
+
+ for (i = 1; i < N; i++)
+ for (j = 1; j < (N-1) ; j++)
+ a[i][j] = a[i-1][j+1] * a[i-1][j+1]/2;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ foo (a[i][j]);
+}
+
+/* Interchange is not legal for loops 0 and 1 of SCoP 2. */
+/* { dg-final { scan-tree-dump-times "Interchange not valid for loops 0 and 1:" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/pr37485.c b/gcc/testsuite/gcc.dg/graphite/pr37485.c
index 67661910ba2..cf0969bac1d 100644
--- a/gcc/testsuite/gcc.dg/graphite/pr37485.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr37485.c
@@ -29,3 +29,4 @@ void fallbackSort ( UInt32* fmap,
AssertH ( j < 256, 1005 );
}
/* { dg-final { scan-tree-dump-times "Loop blocked" 1 "graphite" { xfail *-*-* }} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/pr37684.c b/gcc/testsuite/gcc.dg/graphite/pr37684.c
index 35c32911c30..a9e6f5a4a59 100644
--- a/gcc/testsuite/gcc.dg/graphite/pr37684.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr37684.c
@@ -63,3 +63,5 @@ int BZ2_bzCompressInit
}
prepare_new_block ( s );
}
+
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/pr37883.c b/gcc/testsuite/gcc.dg/graphite/pr37883.c
new file mode 100644
index 00000000000..2ab043adce1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr37883.c
@@ -0,0 +1,11 @@
+/* { dg-options "-O3 -floop-block" } */
+
+void test_sort()
+{
+ char *base;
+ register char c, *i, *hi;
+
+ for (i = base; i < hi; i++)
+ *i++ = c;
+}
+
diff --git a/gcc/testsuite/gcc.dg/graphite/pr37928.c b/gcc/testsuite/gcc.dg/graphite/pr37928.c
new file mode 100644
index 00000000000..47ad5bce0bd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr37928.c
@@ -0,0 +1,33 @@
+/* { dg-options "-O3 -floop-block" } */
+
+int get_state(int size, int *node, int *hash)
+{
+ int i=0;
+ while(hash[i])
+ {
+ if(node[hash[i]] == 0)
+ return hash[i]-1;
+ i++;
+ if(i==5)
+ i=0;
+ }
+ return -1;
+}
+
+void foo (int);
+
+int gate1(int size, int *node, int *hash)
+{
+ int i, j ;
+ int add_size=0;
+ for(i=0; i<size; i++)
+ {
+ j = get_state(size,node, hash);
+ if(j == -1)
+ {
+ add_size++;
+ }
+ }
+
+ foo (size+add_size);
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr38073.c b/gcc/testsuite/gcc.dg/graphite/pr38073.c
new file mode 100644
index 00000000000..9c48d8d095f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr38073.c
@@ -0,0 +1,9 @@
+/* { dg-options "-O3 -fgraphite-identity" } */
+
+test_seg(int a, int b)
+{
+ int i,r=1;
+ for(i=0; i<b ;i++)
+ r*=a;
+ return r;
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr38125.c b/gcc/testsuite/gcc.dg/graphite/pr38125.c
new file mode 100644
index 00000000000..780e6f643e6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr38125.c
@@ -0,0 +1,32 @@
+/* { dg-options "-O3 -fgraphite-identity" } */
+
+typedef struct sv TEST_SV;
+typedef struct av TEST_AV;
+typedef struct magic TEST_MAGIC;
+typedef struct xpvav TEST_XPVAV;
+struct sv
+{
+ void* sv_any;
+};
+struct av
+{
+ TEST_XPVAV* sv_any;
+};
+struct xpvav
+{
+ char* xav_array;
+ long int xav_fill;
+ long int xav_max;
+};
+struct magic {
+ TEST_SV* mg_obj;
+};
+extern TEST_SV PL_sv_undef;
+Perl_av_fill( register TEST_AV *av, int fill)
+{
+ TEST_MAGIC *mg;
+ int key = ((TEST_XPVAV*) (av)->sv_any)->xav_fill;
+ TEST_SV** ary = ((TEST_SV**)((TEST_XPVAV*) (av)->sv_any)->xav_array);
+ while (key < fill)
+ ary[++key] = &PL_sv_undef;
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr38409.c b/gcc/testsuite/gcc.dg/graphite/pr38409.c
new file mode 100644
index 00000000000..41c67753426
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr38409.c
@@ -0,0 +1,24 @@
+/* { dg-options "-O2 -floop-block" } */
+
+typedef struct test input ;
+struct test
+{
+ int type ;
+ int symflag ;
+};
+Chv_copyEntriesToVector ( input *chv,double *dvec)
+{
+ double *entries ;
+ int mm, nent;
+ int first, i, k , stride ;
+ if ( ((chv)->type == 1) )
+ {
+ for ( i = 0 ; i < 10 ; i++)
+ {
+ dvec[2*mm] = entries[2*k] ;
+ k += stride ;
+ stride -= 2 ;
+ }
+ }
+ return(mm) ;
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr38413.c b/gcc/testsuite/gcc.dg/graphite/pr38413.c
new file mode 100644
index 00000000000..6c2b23a8829
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr38413.c
@@ -0,0 +1,14 @@
+/* { dg-options "-O2 -fgraphite-identity" } */
+
+static int qsz;
+
+void specqsort(base, n, size, compar)
+ char *base;
+{
+ register char c, *i, *j, *lo, *hi;
+ qsz = size;
+ for (i = base, hi = base + qsz; i < hi; )
+ {
+ *i++ = c;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr38446.c b/gcc/testsuite/gcc.dg/graphite/pr38446.c
new file mode 100644
index 00000000000..b7b346cd98b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr38446.c
@@ -0,0 +1,14 @@
+/* { dg-options "-O2 -fgraphite-identity" } */
+
+void copy_data()
+{
+ int ****source;
+ int ****dest;
+
+ int i, j, k, l;
+ for (i = 0; i < 10; i++)
+ for (k = 0; k < 2; k++)
+ for (l = 0; l < 65; l++)
+ source[i][j][k][l] = dest[i][j][k][l];
+}
+
diff --git a/gcc/testsuite/gcc.dg/graphite/scop-15.c b/gcc/testsuite/gcc.dg/graphite/scop-15.c
index 7e242537315..9324631e2fd 100644
--- a/gcc/testsuite/gcc.dg/graphite/scop-15.c
+++ b/gcc/testsuite/gcc.dg/graphite/scop-15.c
@@ -48,5 +48,6 @@ int longest_match(IPos cur_match)
&& --chain_length != 0);
return best_len;
}
+
/* { dg-final { scan-tree-dump-times "number of SCoPs: 0" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/scop-16.c b/gcc/testsuite/gcc.dg/graphite/scop-16.c
index 42f7b6aade3..d0b32f63973 100644
--- a/gcc/testsuite/gcc.dg/graphite/scop-16.c
+++ b/gcc/testsuite/gcc.dg/graphite/scop-16.c
@@ -1,4 +1,5 @@
-/* { dg-options "-O2 -floop-block -fdump-tree-graphite-all" } */
+/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
+
#define N 10000
void foo (int);
int test ()
@@ -20,6 +21,5 @@ int test ()
foo (a[i][j]);
}
-/* Interchange is legal for loops 0 and 1 of the first two SCoPs */
-/* { dg-final { scan-tree-dump-times "Interchange valid for loops 0 and 1:" 2 "graphite"} } */
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/scop-17.c b/gcc/testsuite/gcc.dg/graphite/scop-17.c
index 4c1b0ca2993..c2fec3fccaf 100644
--- a/gcc/testsuite/gcc.dg/graphite/scop-17.c
+++ b/gcc/testsuite/gcc.dg/graphite/scop-17.c
@@ -1,4 +1,5 @@
-/* { dg-options "-O2 -floop-block -fdump-tree-graphite-all" } */
+/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
+
#define N 10000
void foo (int);
int test ()
@@ -19,6 +20,5 @@ int test ()
foo (a[i][j]);
}
-/* Interchange is not legal for loops 0 and 1 of SCoP 2. */
-/* { dg-final { scan-tree-dump-times "Interchange not valid for loops 0 and 1:" 1 "graphite"} } */
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/scop-18.c b/gcc/testsuite/gcc.dg/graphite/scop-18.c
index fe2d5f4a412..6264116e114 100644
--- a/gcc/testsuite/gcc.dg/graphite/scop-18.c
+++ b/gcc/testsuite/gcc.dg/graphite/scop-18.c
@@ -1,4 +1,4 @@
-/* { dg-options "-O2 -floop-block -fdump-tree-graphite-all" } */
+/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
#define N 24
#define M 1000
@@ -13,14 +13,14 @@ void test (void)
for (i = 0; i < 24; i++)
for (j = 0; j < 24; j++)
for (k = 0; k < 24; k++)
- A[i][j] += B[i][k] * C[k][j];
+ A[i][j] = B[i][k] * C[k][j];
/* These loops should still be strip mined. */
for (i = 0; i < 1000; i++)
for (j = 0; j < 1000; j++)
for (k = 0; k < 1000; k++)
- A[i][j] += B[i][k] * C[k][j];
+ A[i][j] = B[i][k] * C[k][j];
}
-/* { dg-final { scan-tree-dump-times "Strip Mining is not profitable" 3 "graphite" } } */
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/pr34027-1.c b/gcc/testsuite/gcc.dg/pr34027-1.c
index 532e4976dc3..8e8872a5133 100644
--- a/gcc/testsuite/gcc.dg/pr34027-1.c
+++ b/gcc/testsuite/gcc.dg/pr34027-1.c
@@ -8,5 +8,9 @@ unsigned long foobar(unsigned long ns)
return ns;
}
-/* { dg-final { scan-tree-dump "ns % 10000" "optimized" } } */
+/* This test was originally introduced to test that we transform
+ to ns % 10000. See the discussion of PR 32044 why we do not do
+ that anymore. */
+/* { dg-final { scan-tree-dump-times "%" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "/" 0 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr35442.c b/gcc/testsuite/gcc.dg/pr35442.c
index 4f1e3cc537f..2bf5ce67880 100644
--- a/gcc/testsuite/gcc.dg/pr35442.c
+++ b/gcc/testsuite/gcc.dg/pr35442.c
@@ -9,3 +9,6 @@ foo (A a)
{
((B) a) (); /* { dg-error "is not a function" } */
}
+
+/* Ignore a warning that is irrelevant to the purpose of this test. */
+/* { dg-prune-output ".*GCC vector passed by reference.*" } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr38271.c b/gcc/testsuite/gcc.dg/torture/pr38271.c
new file mode 100644
index 00000000000..2c64a9b34a6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr38271.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+struct xxx {
+ short a;
+ short b;
+ void *c;
+};
+
+void bar(struct xxx);
+
+void foo(struct xxx *p, int i)
+{
+ struct xxx s0 = *p;
+ struct xxx s = s0;
+ if (s.a) i++;
+ bar(s);
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c
index 57db5c32399..9868c078df2 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c
@@ -2,9 +2,8 @@
Target is restricted to x86 type architectures, so that we may
assume something about memory addressing modes. */
-/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-fpic" "-fPIC" } { "" } } */
-/* { dg-options "-O1 -fno-pic -fno-PIC -fdump-tree-optimized" } */
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && nonpic } } } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
int arr_base[100];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr32044.c b/gcc/testsuite/gcc.dg/tree-ssa/pr32044.c
new file mode 100644
index 00000000000..0c1a58206f4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr32044.c
@@ -0,0 +1,55 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-empty -fdump-tree-final_cleanup" } */
+
+int foo (int n)
+{
+ while (n >= 45)
+ n -= 45;
+
+ return n;
+}
+
+int bar (int n)
+{
+ while (n >= 64)
+ n -= 64;
+
+ return n;
+}
+
+int bla (int n)
+{
+ int i = 0;
+
+ while (n >= 45)
+ {
+ i++;
+ n -= 45;
+ }
+
+ return i;
+}
+
+int baz (int n)
+{
+ int i = 0;
+
+ while (n >= 64)
+ {
+ i++;
+ n -= 64;
+ }
+
+ return i;
+}
+
+/* The loops computing division/modulo by 64 should be eliminated. */
+/* { dg-final { scan-tree-dump-times "Removing empty loop" 2 "empty" } } */
+
+/* There should be no division/modulo in the final dump (division and modulo
+ by 64 are done using bit operations). */
+/* { dg-final { scan-tree-dump-times "/" 0 "final_cleanup" } } */
+/* { dg-final { scan-tree-dump-times "%" 0 "final_cleanup" } } */
+
+/* { dg-final { cleanup-tree-dump "empty" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-10.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-10.c
index cfbb9c97b16..a27f2d6c023 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-10.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-10.c
@@ -4,6 +4,8 @@
union loc { unsigned reg; signed offset; };
void __frame_state_for (volatile char *state_in, int x)
{
+ /* We should move all the loads out of this loop. Right now, we only
+ move one. It takes two insertions because we insert a cast. */
union loc fs;
int reg;
for (;;) {
@@ -16,5 +18,5 @@ void __frame_state_for (volatile char *state_in, int x)
}
}
-/* { dg-final { scan-tree-dump-not "Insertions:" "pre" } } */
+/* { dg-final { scan-tree-dump "Insertions: 2" "pre" } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c
index 752c4f61390..5eb01ebba86 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c
@@ -114,7 +114,7 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {target { vect_strided && vect_int_mult } } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" {target { vect_strided && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {target { vect_strided && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" {target { vect_strided && vect_int_mult } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr36630.c b/gcc/testsuite/gcc.dg/vect/pr36630.c
index 9d85afffb20..2253f7574b8 100644
--- a/gcc/testsuite/gcc.dg/vect/pr36630.c
+++ b/gcc/testsuite/gcc.dg/vect/pr36630.c
@@ -13,4 +13,5 @@ foo (unsigned char *x, short y)
i = i + 1;
}
}
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */