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

gcc/ChangeLog:

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

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

gcc/testsuite/ChangeLog:

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

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

From-SVN: r126095
This commit is contained in:
Seongbae Park
2007-06-28 20:48:57 +00:00
committed by Seongbae Park
parent 431e37c238
commit 7b9b2d2152
4 changed files with 20 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
2007-06-28 Seongbae Park <seongbae.park@gmail.com>
* config/arm/arm.c (arm_get_frame_offsets): Set
offsets->locals_base to avoid negative stack size.
(thumb_expand_prologue): Assert on negative stack size.
2007-06-28 Jakub Jelinek <jakub@redhat.com>
* config/rs6000/rs6000.c (rs6000_function_ok_for_sibcall): Ensure

View File

@@ -10555,6 +10555,7 @@ arm_get_frame_offsets (void)
if (leaf && frame_size == 0)
{
offsets->outgoing_args = offsets->soft_frame;
offsets->locals_base = offsets->soft_frame;
return offsets;
}
@@ -13874,6 +13875,7 @@ thumb_expand_epilogue (void)
amount = offsets->locals_base - offsets->saved_regs;
}
gcc_assert (amount >= 0);
if (amount)
{
if (amount < 512)

View File

@@ -1,3 +1,7 @@
2007-06-28 Seongbae Park <seongbae.park@gmail.com>
* gcc.target/arm/stack-corruption.c: New test.
2007-06-27 Simon Martin <simartin@users.sourceforge.net>
PR c++/27492

View File

@@ -0,0 +1,8 @@
/* { 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" } } */