summaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-11 16:22:29 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-11 16:22:29 +0000
commit65433eb43381485d1c35dad98382a2a60e666ed2 (patch)
tree1cb23927181d5252d9655bc7e20fc97b620c0e9d /gcc/stor-layout.c
parentc2b5d5d4c453bccfd7ecd877e3b7a050416d2fed (diff)
downloadgcc-65433eb43381485d1c35dad98382a2a60e666ed2.tar.gz
PR c/10201
* expr.c (expand_expr): Move DECL_RTL frobbing ... * stor-layout.c (layout_decl): ... here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65467 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 106c7c6e65d..c592fa4e401 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -390,6 +390,7 @@ layout_decl (decl, known_align)
{
tree type = TREE_TYPE (decl);
enum tree_code code = TREE_CODE (decl);
+ rtx rtl = NULL_RTX;
if (code == CONST_DECL)
return;
@@ -397,6 +398,8 @@ layout_decl (decl, known_align)
&& code != TYPE_DECL && code != FIELD_DECL)
abort ();
+ rtl = DECL_RTL_IF_SET (decl);
+
if (type == error_mark_node)
type = void_type_node;
@@ -542,6 +545,15 @@ layout_decl (decl, known_align)
larger_than_size);
}
}
+
+ /* If the RTL was already set, update its mode and mem attributes. */
+ if (rtl)
+ {
+ PUT_MODE (rtl, DECL_MODE (decl));
+ SET_DECL_RTL (decl, 0);
+ set_mem_attributes (rtl, decl, 1);
+ SET_DECL_RTL (decl, rtl);
+ }
}
/* Hook for a front-end function that can modify the record layout as needed