aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2000-11-21 17:52:14 -0800
committerRichard Henderson <rth@gcc.gnu.org>2000-11-21 17:52:14 -0800
commitcac16ef9dadc3db4529dbcc204d13101f3e131b4 (patch)
tree515408a85dcc15bfa2477e35305b6f015906427b /gcc
parent033b8a0cdb692bbd6ec2ad2dd4ccc883c878cc09 (diff)
downloadgcc-cac16ef9dadc3db4529dbcc204d13101f3e131b4.zip
gcc-cac16ef9dadc3db4529dbcc204d13101f3e131b4.tar.gz
gcc-cac16ef9dadc3db4529dbcc204d13101f3e131b4.tar.bz2
varasm.c (record_constant): Pad the constructed constant_descriptor appropriately.
* varasm.c (record_constant): Pad the constructed constant_descriptor appropriately. From-SVN: r37638
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/varasm.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a60a7e9..215f3c8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-21 Richard Henderson <rth@redhat.com>
+
+ * varasm.c (record_constant): Pad the constructed
+ constant_descriptor appropriately.
+
Wed Nov 22 00:52:55 2000 J"orn Rennecke <amylaar@redhat.com>
* rtl.h (traverse_md_constants): Declare.
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 799beeb1..e9925bf 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -2797,6 +2797,7 @@ record_constant (exp)
struct constant_descriptor *next = 0;
char *label = 0;
rtx rtl = 0;
+ int pad;
/* Make a struct constant_descriptor. The first three pointers will
be filled in later. Here we just leave space for them. */
@@ -2804,6 +2805,14 @@ record_constant (exp)
obstack_grow (&permanent_obstack, (char *) &next, sizeof next);
obstack_grow (&permanent_obstack, (char *) &label, sizeof label);
obstack_grow (&permanent_obstack, (char *) &rtl, sizeof rtl);
+
+ /* Align the descriptor for the data payload. */
+ pad = (offsetof (struct constant_descriptor, u)
+ - offsetof(struct constant_descriptor, rtl)
+ - sizeof(next->rtl));
+ if (pad > 0)
+ obstack_blank (&permanent_obstack, pad);
+
record_constant_1 (exp);
return (struct constant_descriptor *) obstack_finish (&permanent_obstack);
}