Commit 97955d55 by Richard Kenner Committed by Richard Kenner

function.c (put_var_into_stack): If old RTL was ADDRESSOF, update the address inside the old RTL.

	* function.c (put_var_into_stack): If old RTL was ADDRESSOF, update
	the address inside the old RTL.

From-SVN: r80057
parent 2820d220
2004-03-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* function.c (put_var_into_stack): If old RTL was ADDRESSOF, update
the address inside the old RTL.
2004-03-28 Zack Weinberg <zack@codesourcery.com> 2004-03-28 Zack Weinberg <zack@codesourcery.com>
* c-decl.c: Verify that C_SIZEOF_STRUCT_LANG_IDENTIFIER is correct. * c-decl.c: Verify that C_SIZEOF_STRUCT_LANG_IDENTIFIER is correct.
......
...@@ -1287,7 +1287,7 @@ init_temp_slots (void) ...@@ -1287,7 +1287,7 @@ init_temp_slots (void)
void void
put_var_into_stack (tree decl, int rescan) put_var_into_stack (tree decl, int rescan)
{ {
rtx reg; rtx orig_reg, reg;
enum machine_mode promoted_mode, decl_mode; enum machine_mode promoted_mode, decl_mode;
struct function *function = 0; struct function *function = 0;
tree context; tree context;
...@@ -1299,9 +1299,9 @@ put_var_into_stack (tree decl, int rescan) ...@@ -1299,9 +1299,9 @@ put_var_into_stack (tree decl, int rescan)
context = decl_function_context (decl); context = decl_function_context (decl);
/* Get the current rtl used for this object and its original mode. */ /* Get the current rtl used for this object and its original mode. */
reg = (TREE_CODE (decl) == SAVE_EXPR orig_reg = reg = (TREE_CODE (decl) == SAVE_EXPR
? SAVE_EXPR_RTL (decl) ? SAVE_EXPR_RTL (decl)
: DECL_RTL_IF_SET (decl)); : DECL_RTL_IF_SET (decl));
/* No need to do anything if decl has no rtx yet /* No need to do anything if decl has no rtx yet
since in that case caller is setting TREE_ADDRESSABLE since in that case caller is setting TREE_ADDRESSABLE
...@@ -1366,6 +1366,12 @@ put_var_into_stack (tree decl, int rescan) ...@@ -1366,6 +1366,12 @@ put_var_into_stack (tree decl, int rescan)
else else
put_reg_into_stack (function, reg, TREE_TYPE (decl), promoted_mode, put_reg_into_stack (function, reg, TREE_TYPE (decl), promoted_mode,
decl_mode, volatilep, 0, usedp, 0); decl_mode, volatilep, 0, usedp, 0);
/* If this was previously a MEM but we've removed the ADDRESSOF,
set this address into that MEM so we always use the same
rtx for this variable. */
if (orig_reg != reg && GET_CODE (orig_reg) == MEM)
XEXP (orig_reg, 0) = XEXP (reg, 0);
} }
else if (GET_CODE (reg) == CONCAT) else if (GET_CODE (reg) == CONCAT)
{ {
......
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