]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/13608 (Incorrect code with -O3 -ffast-math)
authorJan Hubicka <jh@suse.cz>
Fri, 16 Jan 2004 19:01:06 +0000 (20:01 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 16 Jan 2004 19:01:06 +0000 (19:01 +0000)
PR opt/13608
* i386.c (ix86_compute_frame_layout): Fix for alloca on leaf function.

From-SVN: r75990

gcc/ChangeLog
gcc/config/i386/i386.c

index 2ae63a75de50f706f1769f0743b25614fcfbb805..0e6aee8c5ca043fd79de5744601dfb9f63db586e 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-16  Jan Hubicka  <jh@suse.cz>
+
+       PR opt/13608
+       * i386.c (ix86_compute_frame_layout): Fix for alloca on leaf function.
+
 2004-01-16  Segher Boessenkool  <boessen@de.ibm.com>
 
         PR target/11793
index 0661d0a59a3057de7a0643eb6e30db9a924cef77..a3e00e58f9b11cd98a93432d318d08b7579a7187 100644 (file)
@@ -4567,8 +4567,12 @@ ix86_compute_frame_layout (frame)
   offset += size;
 
   /* Add outgoing arguments area.  Can be skipped if we eliminated
-     all the function calls as dead code.  */
-  if (ACCUMULATE_OUTGOING_ARGS && !current_function_is_leaf)
+     all the function calls as dead code.
+     Skipping is however impossible when function calls alloca.  Alloca
+     expander assumes that last current_function_outgoing_args_size
+     of stack frame are unused.  */
+  if (ACCUMULATE_OUTGOING_ARGS
+      && (!current_function_is_leaf || current_function_calls_alloca))
     {
       offset += current_function_outgoing_args_size;
       frame->outgoing_arguments_size = current_function_outgoing_args_size;