Commit a3a531ec by Seongbae Park Committed by Seongbae Park

arm.c (arm_get_frame_offsets): Set offsets->locals_base to avoid negative stack size.

gcc/ChangeLog:

2007-06-19  Seongbae Park  <seongbae.park@gmail.com>

	* config/arm/arm.c (arm_get_frame_offsets): Set
	offsets->locals_base to avoid negative stack size.
	(thumb1_expand_prologue): Assert on negative stack size.

gcc/testsuite/ChangeLog:

2007-06-19  Seongbae Park  <seongbae.park@gmail.com>

	* gcc.target/arm/stack-corruption.c: New test.

From-SVN: r125856
parent 0f7c0775
2007-06-19 Seongbae Park <seongbae.park@gmail.com>
* config/arm/arm.c (arm_get_frame_offsets): Set
offsets->locals_base to avoid negative stack size.
(thumb1_expand_prologue): Assert on negative stack size.
2007-04-11 Sebastian Pop <sebpop@gmail.com> 2007-04-11 Sebastian Pop <sebpop@gmail.com>
PR tree-optimization/32367 PR tree-optimization/32367
......
...@@ -11101,6 +11101,7 @@ arm_get_frame_offsets (void) ...@@ -11101,6 +11101,7 @@ arm_get_frame_offsets (void)
if (leaf && frame_size == 0) if (leaf && frame_size == 0)
{ {
offsets->outgoing_args = offsets->soft_frame; offsets->outgoing_args = offsets->soft_frame;
offsets->locals_base = offsets->soft_frame;
return offsets; return offsets;
} }
...@@ -14662,6 +14663,7 @@ thumb1_expand_epilogue (void) ...@@ -14662,6 +14663,7 @@ thumb1_expand_epilogue (void)
amount = offsets->locals_base - offsets->saved_regs; amount = offsets->locals_base - offsets->saved_regs;
} }
gcc_assert (amount >= 0);
if (amount) if (amount)
{ {
if (amount < 512) if (amount < 512)
......
2007-06-19 Seongbae Park <seongbae.park@gmail.com>
* gcc.target/arm/stack-corruption.c: New test.
2007-06-19 Richard Guenther <rguenther@suse.de> 2007-06-19 Richard Guenther <rguenther@suse.de>
* g++.dg/torture/pr30252.C: New testcase. * g++.dg/torture/pr30252.C: New testcase.
/* { dg-do compile } */
/* { dg-options "-O -mthumb -fno-omit-frame-pointer" } */
int main() {
return 0;
}
/* { dg-final { scan-assembler-not "\tadd\tr7, sp, #8\n" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment