This is the mail archive of the gcc-bugs@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: Miscellaneous testsuitsuite failures under hpux 10.20


> The patch to tree.h was rejected.  I will try to install manually.

This is the revised patch based on todays source.

2000-05-13  Geoffrey Keating  <geoffk@cygnus.com>

	* tree.h (DECL_OFFSET_ALIGN): Make the off_align field of
	the tree structure an exponent rather than an explicit alignment
	so it doesn't overflow.
	(SET_DECL_OFFSET_ALIGN): New macro.
	* stor-layout.c (place_union_field): Use SET_DECL_OFFSET_ALIGN
	rather than DECL_OFFSET_ALIGN.
	(place_field): Likewise.


--- stor-layout.c.orig	Thu Jun 15 00:01:55 2000
+++ stor-layout.c	Fri Jun 23 18:19:36 2000
@@ -584,7 +584,7 @@
   
   DECL_FIELD_OFFSET (field) = size_zero_node;
   DECL_FIELD_BIT_OFFSET (field) = bitsize_zero_node;
-  DECL_OFFSET_ALIGN (field) = BIGGEST_ALIGNMENT;
+  SET_DECL_OFFSET_ALIGN (field, BIGGEST_ALIGNMENT);
 
   desired_align = DECL_ALIGN (field);
 
@@ -859,7 +859,7 @@
   normalize_rli (rli);
   DECL_FIELD_OFFSET (field) = rli->offset;
   DECL_FIELD_BIT_OFFSET (field) = rli->bitpos;
-  DECL_OFFSET_ALIGN (field) = rli->offset_align;
+  SET_DECL_OFFSET_ALIGN (field, rli->offset_align);
 
   /* If this field ended up more aligned than we thought it would be (we
      approximate this by seeing if its position changed), lay out the field
--- tree.h.orig	Thu Jun 15 00:01:57 2000
+++ tree.h	Fri Jun 23 18:28:29 2000
@@ -1300,8 +1300,15 @@
 #define DECL_SIZE_UNIT(NODE) (DECL_CHECK (NODE)->decl.size_unit)
 /* Holds the alignment required for the datum.  */
 #define DECL_ALIGN(NODE) (DECL_CHECK (NODE)->decl.u1.a.align)
-/* For FIELD_DECLs, holds the alignment that DECL_FIELD_OFFSET has.  */
-#define DECL_OFFSET_ALIGN(NODE) (FIELD_DECL_CHECK (NODE)->decl.u1.a.off_align)
+/* For FIELD_DECLs, off_align holds the number of low-order bits of
+   DECL_FIELD_OFFSET which are known to be always zero.
+   DECL_OFFSET_ALIGN thus returns the alignment that DECL_FIELD_OFFSET
+   has.  */
+#define DECL_OFFSET_ALIGN(NODE) \
+  (1UL << FIELD_DECL_CHECK (NODE)->decl.u1.a.off_align)
+/* Specify that DECL_ALIGN(NODE) is a multiple of X.  */
+#define SET_DECL_OFFSET_ALIGN(NODE, X) \
+  (FIELD_DECL_CHECK (NODE)->decl.u1.a.off_align = ffs (X) - 1)
 /* 1 if the alignment for this type was requested by "aligned" attribute,
    0 if it is the default for this type.  */
 #define DECL_USER_ALIGN(NODE) (DECL_CHECK (NODE)->decl.user_align)

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