Builds failing on Sparcs

Mark Mitchell mark@codesourcery.com
Fri Jan 5 10:50:00 GMT 2001


>>>>> "Richard" == Richard Earnshaw <rearnsha@arm.com> writes:

    Richard> Mark, builds of the latest CVS code fail on the sparc, my
    Richard> guess is that it is your latest ggc changes are not
    Richard> getting alignments right.

Dang, didn't think of that.  I'll turn off the new code temporarily,
with the attached patch.

What can we do here?  We can of course round to the nearest safe
alignment boundary.  I'll try that.  That will win much less for
platforms that require 16-byte alignment, but there's no way around
that unless callers pass in the alignment as well as the size of the
object they want, and that will be not only hard to implement, but
costly.

This patch is untested (except that it compiles and works a little bit
on x86) -- but since the tree is fried, a quick fix is warranted.
Richard, let me know if this fixes the problem.  I think it should
disable all of the new code.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2001-01-05  Mark Mitchell  <mark@codesourcery.com>

	* ggc-page.c (NUM_EXTRA_ORDERS): Hardwire to zero for now.

Index: ggc-page.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ggc-page.c,v
retrieving revision 1.32
diff -c -p -r1.32 ggc-page.c
*** ggc-page.c	2001/01/04 21:18:27	1.32
--- ggc-page.c	2001/01/05 18:42:05
*************** Boston, MA 02111-1307, USA.  */
*** 140,150 ****
--- 140,161 ----
  /* The size of an object on a page of the indicated ORDER.  */
  #define OBJECT_SIZE(ORDER) object_size_table[ORDER]
  
+ #ifdef NO_ALIGNMENT_PROBLEM
+ 
  /* The number of extra orders, not corresponding to power-of-two sized
     objects.  */
  
  #define NUM_EXTRA_ORDERS \
    (sizeof (extra_order_size_table) / sizeof (extra_order_size_table[0]))
+ 
+ #else /* !defined(NO_ALIGNMENT_PROBLEM) */
+ 
+ /* For now, we can't use this code because we don't ensure that the
+    objects returned are appropriately aligned.  The problem is that
+    some tree_list sized things, for example, use */
+ #define NUM_EXTRA_ORDERS 0
+ 
+ #endif /* !defined(NO_ALIGNMENT_PROBLEM) */
  
  /* The Ith entry is the maximum size of an object to be stored in the
     Ith extra order.  Adding a new entry to this array is the *only*


More information about the Gcc-bugs mailing list