Marek Polacek
2014-10-06 09:45:35 UTC
This patch is a cleanup of tests in gcc.dg/ipa/ directory.
See https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02656.html for more info.
Tested on x86_64-linux: vanilla results == results with this patch ==
results with this patch and gnu11 as a default.
Applying to trunk.
2014-10-06 Marek Polacek <***@redhat.com>
* gcc.dg/ipa/inline-2.c: Fix implicit declarations.
* gcc.dg/ipa/inline-4.c: Likewise.
* gcc.dg/ipa/inline-5.c: Likewise.
* gcc.dg/ipa/pr57539.c: Likewise.
* gcc.dg/ipa/inline-6.c: Fix implicit declarations. Fix
defaulting to int.
* gcc.dg/ipa/inlinehint-1.c: Likewise.
* gcc.dg/ipa/inlinehint-3.c: Likewise.
* gcc.dg/ipa/inlinehint-2.c: Fix defaulting to int.
* gcc.dg/ipa/ipacost-1.c: Likewise.
* gcc.dg/ipa/ipacost-2.c: Likewise.
* gcc.dg/ipa/pure-const-1.c: Use -fgnu89-inline. Fix defaulting
to int.
diff --git gcc/gcc/testsuite/gcc.dg/ipa/inline-2.c gcc/gcc/testsuite/gcc.dg/ipa/inline-2.c
index 376cf97..aa8eea3 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/inline-2.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/inline-2.c
@@ -3,6 +3,7 @@
/* { dg-options "-O3 -c -fdump-ipa-inline -fno-early-inlining" } */
struct bah {int a,b,d;};
+void test3 (int, int, int, int, int);
__attribute__ ((noinline))
void test(int a,int b,int c,int d,int e)
diff --git gcc/gcc/testsuite/gcc.dg/ipa/inline-4.c gcc/gcc/testsuite/gcc.dg/ipa/inline-4.c
index 66019b3..af5c302 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/inline-4.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/inline-4.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
/* { dg-options "-Os -c -fdump-ipa-inline -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
+void work_hard (void);
+
void do_something (int shall_i_work)
{
if (shall_i_work)
diff --git gcc/gcc/testsuite/gcc.dg/ipa/inline-5.c gcc/gcc/testsuite/gcc.dg/ipa/inline-5.c
index d4b7410..f0ee25a 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/inline-5.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/inline-5.c
@@ -1,7 +1,10 @@
/* Check statements that are eliminated by inlining. */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-inline-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
+
struct a {int a,b,c,d,e;};
+void t(int);
+void t2();
void
accessfield (struct a a)
diff --git gcc/gcc/testsuite/gcc.dg/ipa/inline-6.c gcc/gcc/testsuite/gcc.dg/ipa/inline-6.c
index d981bb0..5fb4084 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/inline-6.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/inline-6.c
@@ -1,7 +1,12 @@
/* Check statements that are eliminated by inlining. */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-inline-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
-static t(int a)
+
+void foo (void);
+void bar (void);
+void bagr (void);
+
+static int t(int a)
{
if (a==1)
{
@@ -32,6 +37,7 @@ static t(int a)
bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); b
agr(); bagr();
}
}
+int
main()
{
t(1);
diff --git gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-1.c gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-1.c
index 9810e25..1cc5bdd 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-1.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-1.c
@@ -1,4 +1,6 @@
/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */
+void test2 (int);
+int
test (int a)
{
int i;
@@ -8,6 +10,7 @@ test (int a)
test2(a);
}
}
+int
m()
{
test (10);
diff --git gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-2.c gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-2.c
index a06d725..1579c24 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-2.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-2.c
@@ -1,10 +1,12 @@
/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */
+int
t(int s, void **p)
{
int i;
for (i;i<10000;i+=s)
p[i]=0;
}
+int
m(void **p)
{
t (10, p);
diff --git gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c
index 110ae44..f8d61a0 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c
@@ -1,5 +1,6 @@
/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */
void abort (void);
+int scc_entry (int);
int sum;
int a[10];
int
@@ -20,6 +21,7 @@ scc_entry (int c)
scc_next (c);
return sum;
}
+int
main()
{
int sum;
diff --git gcc/gcc/testsuite/gcc.dg/ipa/ipacost-1.c gcc/gcc/testsuite/gcc.dg/ipa/ipacost-1.c
index 4fce41e..70c635e 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/ipacost-1.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/ipacost-1.c
@@ -43,6 +43,7 @@ i_can_not_be_propagated_fully2 (int *a)
i_can_not_be_propagated_fully (a);
i_can_not_be_propagated_fully (a);
}
+int
main()
{
i_can_be_propagated_fully2 (array);
diff --git gcc/gcc/testsuite/gcc.dg/ipa/ipacost-2.c gcc/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
index ceb524e..290d125 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
@@ -59,6 +59,7 @@ i_can_not_be_propagated_fully2 (int *a)
}
i_can_not_be_propagated_fully (a);
}
+int
main()
{
int i;
diff --git gcc/gcc/testsuite/gcc.dg/ipa/pr57539.c gcc/gcc/testsuite/gcc.dg/ipa/pr57539.c
index e02018e..514b600 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/pr57539.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/pr57539.c
@@ -91,6 +91,8 @@ typedef struct nitem
nitem;
typedef int (*distfn) (box *, box *);
typedef int (*intersectfn) (nitem *, nitem *);
+int agnnodes (graph_t *);
+int overlaps (nitem *, int);
static int
cmpitem (Dt_t * d, int *p1, int *p2, Dtdisc_t * disc)
{
diff --git gcc/gcc/testsuite/gcc.dg/ipa/pure-const-1.c gcc/gcc/testsuite/gcc.dg/ipa/pure-const-1.c
index f76dd87..3f04c86 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/pure-const-1.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/pure-const-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target nonpic } } */
-/* { dg-options "-O3 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const -fdump-tree-optimized -fno-early-inlining" } */
+/* { dg-options "-O3 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const -fdump-tree-optimized -fno-early-inlining -fgnu89-inline" } */
void abort (void);
int error_code;
static int val;
@@ -32,20 +32,20 @@ call_callback(int (*fn)(int), int a)
return fn(a);
}
-__attribute__ ((noinline, noclone))
+__attribute__ ((noinline, noclone)) int
i_am_const3(int a)
{
return call_callback (call_me, a);
}
-__attribute__ ((noinline))
+__attribute__ ((noinline)) int
explode_badly()
{
error_code = 0xbad;
abort ();
}
-__attribute__ ((noinline, noclone))
+__attribute__ ((noinline, noclone)) int
i_am_pure4(int a)
{
if (a > 50)
@@ -53,6 +53,7 @@ i_am_pure4(int a)
return a;
}
+int
test()
{
int s;
Marek
See https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02656.html for more info.
Tested on x86_64-linux: vanilla results == results with this patch ==
results with this patch and gnu11 as a default.
Applying to trunk.
2014-10-06 Marek Polacek <***@redhat.com>
* gcc.dg/ipa/inline-2.c: Fix implicit declarations.
* gcc.dg/ipa/inline-4.c: Likewise.
* gcc.dg/ipa/inline-5.c: Likewise.
* gcc.dg/ipa/pr57539.c: Likewise.
* gcc.dg/ipa/inline-6.c: Fix implicit declarations. Fix
defaulting to int.
* gcc.dg/ipa/inlinehint-1.c: Likewise.
* gcc.dg/ipa/inlinehint-3.c: Likewise.
* gcc.dg/ipa/inlinehint-2.c: Fix defaulting to int.
* gcc.dg/ipa/ipacost-1.c: Likewise.
* gcc.dg/ipa/ipacost-2.c: Likewise.
* gcc.dg/ipa/pure-const-1.c: Use -fgnu89-inline. Fix defaulting
to int.
diff --git gcc/gcc/testsuite/gcc.dg/ipa/inline-2.c gcc/gcc/testsuite/gcc.dg/ipa/inline-2.c
index 376cf97..aa8eea3 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/inline-2.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/inline-2.c
@@ -3,6 +3,7 @@
/* { dg-options "-O3 -c -fdump-ipa-inline -fno-early-inlining" } */
struct bah {int a,b,d;};
+void test3 (int, int, int, int, int);
__attribute__ ((noinline))
void test(int a,int b,int c,int d,int e)
diff --git gcc/gcc/testsuite/gcc.dg/ipa/inline-4.c gcc/gcc/testsuite/gcc.dg/ipa/inline-4.c
index 66019b3..af5c302 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/inline-4.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/inline-4.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
/* { dg-options "-Os -c -fdump-ipa-inline -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
+void work_hard (void);
+
void do_something (int shall_i_work)
{
if (shall_i_work)
diff --git gcc/gcc/testsuite/gcc.dg/ipa/inline-5.c gcc/gcc/testsuite/gcc.dg/ipa/inline-5.c
index d4b7410..f0ee25a 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/inline-5.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/inline-5.c
@@ -1,7 +1,10 @@
/* Check statements that are eliminated by inlining. */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-inline-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
+
struct a {int a,b,c,d,e;};
+void t(int);
+void t2();
void
accessfield (struct a a)
diff --git gcc/gcc/testsuite/gcc.dg/ipa/inline-6.c gcc/gcc/testsuite/gcc.dg/ipa/inline-6.c
index d981bb0..5fb4084 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/inline-6.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/inline-6.c
@@ -1,7 +1,12 @@
/* Check statements that are eliminated by inlining. */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-inline-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
-static t(int a)
+
+void foo (void);
+void bar (void);
+void bagr (void);
+
+static int t(int a)
{
if (a==1)
{
@@ -32,6 +37,7 @@ static t(int a)
bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); b
agr(); bagr();
}
}
+int
main()
{
t(1);
diff --git gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-1.c gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-1.c
index 9810e25..1cc5bdd 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-1.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-1.c
@@ -1,4 +1,6 @@
/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */
+void test2 (int);
+int
test (int a)
{
int i;
@@ -8,6 +10,7 @@ test (int a)
test2(a);
}
}
+int
m()
{
test (10);
diff --git gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-2.c gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-2.c
index a06d725..1579c24 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-2.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-2.c
@@ -1,10 +1,12 @@
/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */
+int
t(int s, void **p)
{
int i;
for (i;i<10000;i+=s)
p[i]=0;
}
+int
m(void **p)
{
t (10, p);
diff --git gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c
index 110ae44..f8d61a0 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c
@@ -1,5 +1,6 @@
/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */
void abort (void);
+int scc_entry (int);
int sum;
int a[10];
int
@@ -20,6 +21,7 @@ scc_entry (int c)
scc_next (c);
return sum;
}
+int
main()
{
int sum;
diff --git gcc/gcc/testsuite/gcc.dg/ipa/ipacost-1.c gcc/gcc/testsuite/gcc.dg/ipa/ipacost-1.c
index 4fce41e..70c635e 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/ipacost-1.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/ipacost-1.c
@@ -43,6 +43,7 @@ i_can_not_be_propagated_fully2 (int *a)
i_can_not_be_propagated_fully (a);
i_can_not_be_propagated_fully (a);
}
+int
main()
{
i_can_be_propagated_fully2 (array);
diff --git gcc/gcc/testsuite/gcc.dg/ipa/ipacost-2.c gcc/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
index ceb524e..290d125 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
@@ -59,6 +59,7 @@ i_can_not_be_propagated_fully2 (int *a)
}
i_can_not_be_propagated_fully (a);
}
+int
main()
{
int i;
diff --git gcc/gcc/testsuite/gcc.dg/ipa/pr57539.c gcc/gcc/testsuite/gcc.dg/ipa/pr57539.c
index e02018e..514b600 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/pr57539.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/pr57539.c
@@ -91,6 +91,8 @@ typedef struct nitem
nitem;
typedef int (*distfn) (box *, box *);
typedef int (*intersectfn) (nitem *, nitem *);
+int agnnodes (graph_t *);
+int overlaps (nitem *, int);
static int
cmpitem (Dt_t * d, int *p1, int *p2, Dtdisc_t * disc)
{
diff --git gcc/gcc/testsuite/gcc.dg/ipa/pure-const-1.c gcc/gcc/testsuite/gcc.dg/ipa/pure-const-1.c
index f76dd87..3f04c86 100644
--- gcc/gcc/testsuite/gcc.dg/ipa/pure-const-1.c
+++ gcc/gcc/testsuite/gcc.dg/ipa/pure-const-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target nonpic } } */
-/* { dg-options "-O3 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const -fdump-tree-optimized -fno-early-inlining" } */
+/* { dg-options "-O3 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const -fdump-tree-optimized -fno-early-inlining -fgnu89-inline" } */
void abort (void);
int error_code;
static int val;
@@ -32,20 +32,20 @@ call_callback(int (*fn)(int), int a)
return fn(a);
}
-__attribute__ ((noinline, noclone))
+__attribute__ ((noinline, noclone)) int
i_am_const3(int a)
{
return call_callback (call_me, a);
}
-__attribute__ ((noinline))
+__attribute__ ((noinline)) int
explode_badly()
{
error_code = 0xbad;
abort ();
}
-__attribute__ ((noinline, noclone))
+__attribute__ ((noinline, noclone)) int
i_am_pure4(int a)
{
if (a > 50)
@@ -53,6 +53,7 @@ i_am_pure4(int a)
return a;
}
+int
test()
{
int s;
Marek