From 8994e34a895be02d645de5cd6802e82900e4b705 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Mon, 6 Oct 2014 09:47:03 +0000 Subject: [PATCH] inline-2.c: Fix implicit declarations. * 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. From-SVN: r215920 --- gcc/testsuite/ChangeLog | 16 ++++++++++++++++ gcc/testsuite/gcc.dg/ipa/inline-2.c | 1 + gcc/testsuite/gcc.dg/ipa/inline-4.c | 2 ++ gcc/testsuite/gcc.dg/ipa/inline-5.c | 3 +++ gcc/testsuite/gcc.dg/ipa/inline-6.c | 8 +++++++- gcc/testsuite/gcc.dg/ipa/inlinehint-1.c | 3 +++ gcc/testsuite/gcc.dg/ipa/inlinehint-2.c | 2 ++ gcc/testsuite/gcc.dg/ipa/inlinehint-3.c | 2 ++ gcc/testsuite/gcc.dg/ipa/ipacost-1.c | 1 + gcc/testsuite/gcc.dg/ipa/ipacost-2.c | 1 + gcc/testsuite/gcc.dg/ipa/pr57539.c | 2 ++ gcc/testsuite/gcc.dg/ipa/pure-const-1.c | 9 +++++---- 12 files changed, 45 insertions(+), 5 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c5d074ca311..586df821e3f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,19 @@ +2014-10-06 Marek Polacek + + * 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. + 2014-10-06 Marek Polacek * gcc.dg/debug/20010207-1.c: Use -fgnu89-inline. Fix implicit diff --git a/gcc/testsuite/gcc.dg/ipa/inline-2.c b/gcc/testsuite/gcc.dg/ipa/inline-2.c index 376cf97e841..aa8eea3fa94 100644 --- a/gcc/testsuite/gcc.dg/ipa/inline-2.c +++ b/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 a/gcc/testsuite/gcc.dg/ipa/inline-4.c b/gcc/testsuite/gcc.dg/ipa/inline-4.c index 66019b30f2e..af5c3020f09 100644 --- a/gcc/testsuite/gcc.dg/ipa/inline-4.c +++ b/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 a/gcc/testsuite/gcc.dg/ipa/inline-5.c b/gcc/testsuite/gcc.dg/ipa/inline-5.c index d4b74104cad..f0ee25adcbf 100644 --- a/gcc/testsuite/gcc.dg/ipa/inline-5.c +++ b/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 a/gcc/testsuite/gcc.dg/ipa/inline-6.c b/gcc/testsuite/gcc.dg/ipa/inline-6.c index d981bb0064e..5fb40842789 100644 --- a/gcc/testsuite/gcc.dg/ipa/inline-6.c +++ b/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(); bagr(); bagr(); } } +int main() { t(1); diff --git a/gcc/testsuite/gcc.dg/ipa/inlinehint-1.c b/gcc/testsuite/gcc.dg/ipa/inlinehint-1.c index 9810e25c19b..1cc5bdd0c07 100644 --- a/gcc/testsuite/gcc.dg/ipa/inlinehint-1.c +++ b/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 a/gcc/testsuite/gcc.dg/ipa/inlinehint-2.c b/gcc/testsuite/gcc.dg/ipa/inlinehint-2.c index a06d7255629..1579c2496bc 100644 --- a/gcc/testsuite/gcc.dg/ipa/inlinehint-2.c +++ b/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 a/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c b/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c index 110ae443c67..f8d61a07efc 100644 --- a/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c +++ b/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 a/gcc/testsuite/gcc.dg/ipa/ipacost-1.c b/gcc/testsuite/gcc.dg/ipa/ipacost-1.c index 4fce41e8235..70c635e6bba 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipacost-1.c +++ b/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 a/gcc/testsuite/gcc.dg/ipa/ipacost-2.c b/gcc/testsuite/gcc.dg/ipa/ipacost-2.c index ceb524e00ae..290d1254c2d 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipacost-2.c +++ b/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 a/gcc/testsuite/gcc.dg/ipa/pr57539.c b/gcc/testsuite/gcc.dg/ipa/pr57539.c index e02018eb872..514b6007929 100644 --- a/gcc/testsuite/gcc.dg/ipa/pr57539.c +++ b/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 a/gcc/testsuite/gcc.dg/ipa/pure-const-1.c b/gcc/testsuite/gcc.dg/ipa/pure-const-1.c index f76dd87d4dd..3f04c861bbc 100644 --- a/gcc/testsuite/gcc.dg/ipa/pure-const-1.c +++ b/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; -- 2.30.2