[backport from gcc-4.7/trunk ] gcc/ 2011-03-17 Chung-Lin Tang PR target/43872 * config/arm/arm.c (arm_get_frame_offsets): Adjust early return condition with !cfun->calls_alloca. --- gcc-4.6-20110318/gcc/config/arm/arm.c.~1~ 2011-01-29 04:20:57.000000000 +0100 +++ gcc-4.6-20110318/gcc/config/arm/arm.c 2011-03-21 10:58:46.000000000 +0100 @@ -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;