This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix sibcall-6.c testcase
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 15 May 2009 18:30:30 +0200
- Subject: Fix sibcall-6.c testcase
Hi,
sibcall-6.c tests that sibcall conversion happens on indirect calls.
The testcase was "broken" for a while, since ipa-cp now works out the
constant and optimizes indirect call away. Moreover we can not inline
the call preventing the sibcall transformation.
Regtested x86_64-linux and will commit it shortly.
* sibcall-6.c: Add no-ipa-cp argument and mark the function to be
optimized by sibcall noinline.
Index: sibcall-6.c
===================================================================
--- sibcall-6.c (revision 147583)
+++ sibcall-6.c (working copy)
@@ -8,7 +8,7 @@
/* { dg-do run { target i?86-*-* x86_64-*-* s390*-*-* } } */
/* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && { ilp32 && { ! nonpic } } } { "*" } { "" } } */
-/* { dg-options "-O2 -foptimize-sibling-calls" } */
+/* { dg-options "-O2 -foptimize-sibling-calls -fno-ipa-cp" } */
extern void abort (void);
extern void exit (int);
@@ -27,7 +27,7 @@ main ()
exit (0);
}
-int
+int __attribute__ ((noinline))
bar (b)
int b;
{
@@ -37,7 +37,7 @@ bar (b)
abort ();
}
-int
+int __attribute__ ((noinline))
foo (f)
int f;
{