This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ia64-linux bootstrap failure, long double string table breakage


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);
  }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]