diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fecac218bf5a..023414679c81 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-04-21 Richard Kenner + + * expr.c (store_constructor): Set RTX_UNCHANGING_P if readonly_field_p + before clearing. + 2003-04-21 Mark Mitchell * config/i386/winnt.c (i386_pe_mark_dllimport): Make the new RTL diff --git a/gcc/expr.c b/gcc/expr.c index abf0875c849a..f87f9c900ff3 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -4899,7 +4899,15 @@ store_constructor (exp, target, cleared, size) || ((HOST_WIDE_INT) GET_MODE_SIZE (GET_MODE (target)) == size))) { - clear_storage (target, GEN_INT (size)); + rtx xtarget = target; + + if (readonly_fields_p (type)) + { + xtarget = copy_rtx (xtarget); + RTX_UNCHANGING_P (xtarget) = 1; + } + + clear_storage (xtarget, GEN_INT (size)); cleared = 1; }