This is the mail archive of the gcc@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: Bug on PPC (no patch yet)


> >   > compile/961203-1.c
> >   > It gets into an infinite recursion between extract_fixed_bit_field()  and
> > Known problem.
> 
> It fails because the offset as measured in bits exceeds 32 bits, and bad
> things happen.
> 
> My reaction to that particular bug is "who cares?"  Why not just mark it
> as XFAIL on 32-bit platforms, if we don't intend to fix it?  It's not like

Because it torments the hell out of the VM system when it runs, consuming
all the VM and having Bad Effects on system performance in general.  On my
system, when I run runtest without ulimit-ing the VM, I end up with 
corefiles from this test in the hundreds of megabytes range. 

> appeared in a real program.  If folks really *are* worried about it
> appearing in a real program, possibly we could attempt to produce a
> "sorry, not implemented: bit offset too large" message rather than an
> infinite recursion.

On March 13, Alexandre Oliva implemented just that.  The patch, often 
cited, has never appeared in a GCC/EGCS snapshot.  It's not in gcc-1021. 
I'd like to see something like this patch and the test marked xfail so
that the test would fail quickly and without dogging swap in the process.

Patch from AO.

--- stor-layout.c~      Thu Mar 13 03:08:23 1997
+++ stor-layout.c       Thu Mar 13 03:22:39 1997
@@ -995,6 +995,12 @@
   if (TYPE_SIZE (type) != 0 && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
     TYPE_SIZE (type) = variable_size (TYPE_SIZE (type));

+  /* If type is negative, produce an internal compiler error.
+     This may be caused by an array that is too large. */
+  if (TYPE_SIZE (type) != 0 && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
+      && TREE_INT_CST_LOW(TYPE_SIZE (type)) < 0)
+    fatal("internal compiler error: type too big");
+
   /* Also layout any other variants of the type.  */
   if (TYPE_NEXT_VARIANT (type)
       || type != TYPE_MAIN_VARIANT (type))



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