OSDN Git Service

* stor-layout.c (layout_decl): Unshare size expressions copied
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 18 Dec 2004 19:18:48 +0000 (19:18 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 18 Dec 2004 19:18:48 +0000 (19:18 +0000)
        from the type.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92359 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/stor-layout.c

index 64935f6..e868413 100644 (file)
@@ -1,5 +1,8 @@
 2004-12-18  Richard Henderson  <rth@redhat.com>
 
+       * stor-layout.c (layout_decl): Unshare size expressions copied
+       from the type.
+
        * fold-const.c (multiple_of_p): Handle BIT_AND_EXPR when
        BOTTOM is a power of two.
 
index ac7fb74..b2f73f0 100644 (file)
@@ -325,8 +325,8 @@ layout_decl (tree decl, unsigned int known_align)
 
   if (DECL_SIZE (decl) == 0)
     {
-      DECL_SIZE (decl) = TYPE_SIZE (type);
-      DECL_SIZE_UNIT (decl) = TYPE_SIZE_UNIT (type);
+      DECL_SIZE (decl) = unsave_expr (TYPE_SIZE (type));
+      DECL_SIZE_UNIT (decl) = unsave_expr (TYPE_SIZE_UNIT (type));
     }
   else if (DECL_SIZE_UNIT (decl) == 0)
     DECL_SIZE_UNIT (decl)