2011-03-17 Chung-Lin Tang <cltang@codesourcery.com>
authorcltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Mar 2011 14:02:12 +0000 (14:02 +0000)
committercltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Mar 2011 14:02:12 +0000 (14:02 +0000)
PR target/43872
* config/arm/arm.c (arm_get_frame_offsets): Adjust early
return condition with !cfun->calls_alloca.

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

gcc/ChangeLog
gcc/config/arm/arm.c

index d5a5592..bc80f7a 100644 (file)
@@ -1,3 +1,9 @@
+2011-03-17  Chung-Lin Tang  <cltang@codesourcery.com>
+
+       PR target/43872
+       * config/arm/arm.c (arm_get_frame_offsets): Adjust early
+       return condition with !cfun->calls_alloca.
+
 2011-03-17  Richard Guenther  <rguenther@suse.de>
 
        PR bootstrap/48148
index 8515002..c6ba3fb 100644 (file)
@@ -15415,7 +15415,10 @@ arm_get_frame_offsets (void)
   offsets->soft_frame = offsets->saved_regs + CALLER_INTERWORKING_SLOT_SIZE;
   /* A leaf function does not need any stack alignment if it has nothing
      on the stack.  */
-  if (leaf && frame_size == 0)
+  if (leaf && frame_size == 0
+      /* However if it calls alloca(), we have a dynamically allocated
+        block of BIGGEST_ALIGNMENT on stack, so still do stack alignment.  */
+      && ! cfun->calls_alloca)
     {
       offsets->outgoing_args = offsets->soft_frame;
       offsets->locals_base = offsets->soft_frame;