From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Lipe To: Joe Buck Cc: law@cygnus.com, sopwith@cuc.edu, egcs@cygnus.com Subject: Re: Bug on PPC (no patch yet) Date: Tue, 21 Oct 1997 09:43:00 -0000 Message-id: <19971021114235.61682@dgii.com> References: <23546.877448283@hurl.cygnus.com> <199710211602.JAA11568@atrus.synopsys.com> X-SW-Source: 1997-10/msg00911.html > > > 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))