sibcall.c (optimize_sibling_and_tail_recursive_call): Suppress optimization if curren...
authorRichard Henderson <rth@redhat.com>
Mon, 4 Jun 2001 20:20:35 +0000 (13:20 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 4 Jun 2001 20:20:35 +0000 (13:20 -0700)
        * sibcall.c (optimize_sibling_and_tail_recursive_call): Suppress
        optimization if current_function_calls_setjmp.

From-SVN: r42880

gcc/ChangeLog
gcc/sibcall.c

index b835dd955b656097d34793ce99f86add6d5a49d0..0fb8a8c05145844dab11897fd612ad9e029faee4 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-04  Richard Henderson  <rth@redhat.com>
+
+       * sibcall.c (optimize_sibling_and_tail_recursive_call): Suppress
+       optimization if current_function_calls_setjmp.
+
 2001-06-04  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * doc/c-tree.texi: Fix documentation of TREE_STRING_LENGTH for
index 53ce4317c960ed6bf048b15a8793d0a4ed31868a..eefe0809eec4345e8bfcd499eff985f3c6509165 100644 (file)
@@ -617,11 +617,15 @@ optimize_sibling_and_tail_recursive_calls ()
 
          /* See if there are any reasons we can't perform either sibling or
             tail call optimizations.  We must be careful with stack slots
-            which are live at potential optimization sites.  ?!? The first
+            which are live at potential optimization sites.  ??? The first
             test is overly conservative and should be replaced.  */
          if (frame_offset
              /* Can't take address of local var if used by recursive call.  */
              || current_function_uses_addressof
+             /* Any function that calls setjmp might have longjmp called from
+                any called function.  ??? We really should represent this
+                properly in the CFG so that this needn't be special cased.  */
+             || current_function_calls_setjmp
              /* Can't if more than one successor or single successor is not
                 exit block.  These two tests prevent tail call optimization
                 in the presense of active exception handlers.  */