aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-12-18 11:18:48 -0800
committerRichard Henderson <rth@gcc.gnu.org>2004-12-18 11:18:48 -0800
commit3e527d38c33ababd3345a46d5cdd9ffc8ac6f6d3 (patch)
treeb2cb5728f1af82fc98c6ad53b215d9b01cffdb75
parent2931700801f5ac2d996bc35927674e314629062c (diff)
downloadgcc-3e527d38c33ababd3345a46d5cdd9ffc8ac6f6d3.zip
gcc-3e527d38c33ababd3345a46d5cdd9ffc8ac6f6d3.tar.gz
gcc-3e527d38c33ababd3345a46d5cdd9ffc8ac6f6d3.tar.bz2
stor-layout.c (layout_decl): Unshare size expressions copied from the type.
* stor-layout.c (layout_decl): Unshare size expressions copied from the type. From-SVN: r92359
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/stor-layout.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 64935f6..e868413 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index ac7fb74..b2f73f0 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -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)