This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ia64-linux bootstrap failure, long double string table breakage
- To: Jim Wilson <wilson at cygnus dot com>
- Subject: Re: ia64-linux bootstrap failure, long double string table breakage
- From: Richard Henderson <rth at redhat dot com>
- Date: Tue, 21 Nov 2000 17:53:02 -0800
- Cc: rearnsha at arm dot com, gcc-patches at gcc dot gnu dot org
- References: <200011212232.OAA16373@wilson.cygnus.com>
On Tue, Nov 21, 2000 at 02:32:37PM -0800, Jim Wilson wrote:
> Unfortunately, code that creates these structures was not similarly modified.
> record_constant creates these structures by calling obstack_grow, but there
> is no code to emit padding.
Fixed thus.
r~
* varasm.c (record_constant): Pad the constructed
constant_descriptor appropriately.
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/varasm.c,v
retrieving revision 1.144
diff -c -p -d -r1.144 varasm.c
*** varasm.c 2000/11/19 23:40:37 1.144
--- varasm.c 2000/11/22 01:12:11
*************** record_constant (exp)
*** 2797,2802 ****
--- 2797,2803 ----
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. */
*************** record_constant (exp)
*** 2804,2809 ****
--- 2805,2818 ----
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);
}