This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Augment last change put_var_into_dec for indirect case
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 31 Mar 04 13:20:32 EST
- Subject: Augment last change put_var_into_dec for indirect case
If we are putting a variable into a register where the pseudo is the address
of the variable, we have to treat that register as the variable and hence
reset ORIG_REG to it.
If this is not done, it caused problems on Sparc, for example the following
testcase in Ada:
procedure P IS
Filler : constant Character := 'X';
procedure Fill
(To : in out String; N : in Natural)
is
procedure Do_It is
begin
To (N) := Filler;
end;
begin
Do_It;
end;
S : String (1 .. 12);
begin
Fill (S, 2);
if S(2) /= Filler then
raise Program_Error;
end if;
end;
Tested on x86-64-linux.
2004-03-31 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* function.c (put_var_into_stack): Properly set orig_reg for indirect.
*** function.c 29 Mar 2004 14:48:45 -0000 1.507
--- function.c 31 Mar 2004 18:08:22 -0000
*************** put_var_into_stack (tree decl, int resca
*** 1334,1338 ****
&& REGNO (XEXP (reg, 0)) > LAST_VIRTUAL_REGISTER)
{
! reg = XEXP (reg, 0);
decl_mode = promoted_mode = GET_MODE (reg);
}
--- 1334,1338 ----
&& REGNO (XEXP (reg, 0)) > LAST_VIRTUAL_REGISTER)
{
! orig_reg = reg = XEXP (reg, 0);
decl_mode = promoted_mode = GET_MODE (reg);
}