i386.c (release_scratch_register_on_entry): Also adjust sp_offset manually.

* config/i386/i386.c (release_scratch_register_on_entry): Also adjust
	sp_offset manually.

From-SVN: r193353
This commit is contained in:
Eric Botcazou 2012-11-09 09:13:25 +00:00 committed by Eric Botcazou
parent dc9040d883
commit 6bbb3874a0
5 changed files with 52 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2012-11-09 Eric Botcazou <ebotcazou@adacore.com>
* config/i386/i386.c (release_scratch_register_on_entry): Also adjust
sp_offset manually.
2012-11-07 Uros Bizjak <ubizjak@gmail.com>
Backport from mainline

View File

@ -9604,6 +9604,7 @@ release_scratch_register_on_entry (struct scratch_reg *sr)
{
if (sr->saved)
{
struct machine_function *m = cfun->machine;
rtx x, insn = emit_insn (gen_pop (sr->reg));
/* The RTX_FRAME_RELATED_P mechanism doesn't know about pop. */
@ -9611,6 +9612,7 @@ release_scratch_register_on_entry (struct scratch_reg *sr)
x = gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (UNITS_PER_WORD));
x = gen_rtx_SET (VOIDmode, stack_pointer_rtx, x);
add_reg_note (insn, REG_FRAME_RELATED_EXPR, x);
m->fs.sp_offset -= UNITS_PER_WORD;
}
}

View File

@ -1,3 +1,7 @@
2012-11-09 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/stack_check3.ad[sb]: New test.
2012-11-07 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/compile/20121107-1.c: New test.

View File

@ -0,0 +1,36 @@
-- { dg-do compile }
-- { dg-options "-O -fstack-check" }
package body Stack_Check3 is
type Int_Arr is array (1 .. 34) of Integer;
type Rec (D : Boolean := False) is
record
case D is
when True => IA : Int_Arr;
when False => null;
end case;
end record;
type Rec_Arr is array (1 .. 256) of Rec;
protected Prot_Arr is
procedure Reset;
private
A : Rec_Arr;
end Prot_Arr;
protected body Prot_Arr is
procedure Reset is
begin
A := (others => (D => False));
end Reset;
end Prot_Arr;
procedure Reset is
begin
Prot_Arr.Reset;
end Reset;
end Stack_Check3;

View File

@ -0,0 +1,5 @@
package Stack_Check3 is
procedure Reset;
end Stack_Check3;