* gcc.dg/always_inline3.c: Update for pre-inline tail recursion
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 14 Jan 2007 18:23:31 +0000 (18:23 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 14 Jan 2007 18:23:31 +0000 (18:23 +0000)
elimination.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120777 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/always_inline3.c

index 8402f29..ed3350d 100644 (file)
@@ -1,3 +1,8 @@
+2007-01-14  Jan Hubicka  <jh@suse.cz>
+
+       * gcc.dg/always_inline3.c: Update for pre-inline tail recursion
+       elimination.
+
 2007-01-14  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/30410
index e1a337c..7b575d7 100644 (file)
@@ -1,10 +1,11 @@
 /* { dg-do compile } */
 /* { dg-options "-Winline -O2" } */
-void do_something_evil (void);
+int do_something_evil (void);
 inline __attribute__ ((always_inline)) void
 q2(void)
 {                              /* { dg-error "recursive" "" } */
-  do_something_evil ();
-  q2();                        /* { dg-error "called from here" "" } */
+  if (do_something_evil ())
+    return;
   q2();                        /* { dg-error "called from here" "" } */
+  q2(); /* With -O2 we don't warn here, it is eliminated by tail recursion.  */
 }