This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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);
      }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]