abort() in function.c (arm-linux, only with -O or -O2)
Jamie Guinan
guinan@bluebutton.com
Wed May 12 02:52:00 GMT 1999
Hi all,
I have a source module from the GTK library that triggers abort() in both
the 19990502 snapshot and today's CVS sources (19990511), when
optimization is on.
I'm doing a bootstrap build on a Corel Netwinder, using gcc-2.8.1
for the stage 1 build.
I've narrowed the problem code from GTK down to a .i file with a single
function in it. You can download it at,
http://www.bluebutton.com/jamie/gtk/gtk_button_test.i.gz
It gunzip's to 200k, but thats largely GTK prototypes and typedefs
and preprocessor whitespace. The actual function, called
gtk_button_size_allocate(), is down at the bottom and is barely
50 lines, although the GTK macro expansions are quite hairy.
I had to apply some patches to get the self-hosted build to work,
These are not "official" patches so please don't bug or blame the author
(Phil B.). I don't think the patches relate to the abort() condition but
I can't be 100% sure and I don't want to cause headaches for him. The
patches I used are located at,
ftp://ftp.netwinder.org/users/p/philb/egcs-990419-arm-diff.gz
I applied these patches directly to the 19990502 snapshot, and I did a
manual patch against today's CVS tree. Here is the "cvs diff" output
from inside gcc/config/arm,
http://www.bluebutton.com/jamie/gtk/cvs-diffs-19990511
(the result is basically equivalent to Phil's patches).
More details for anyone who's interested:
The gcc code that is aborting is function.c:purge_addressof_1().
In the 19990502 snapshot, it aborts here around line 3136,
if (GET_MODE_SIZE (GET_MODE (x))
< GET_MODE_SIZE (GET_MODE (y)))
abort ();
I added a few debugging printf's and found that MODE(x) is HI
(half integer, two byte) and MODE(y) is "SI" (single integer,
four byte). Thus ( 2 < 4 ) and it aborts.
In today's CVS sources, this code has changed somewhat, but it
still isn't able to find a suitable replacement rtx and it
aborts here around line 3171,
/* There should always be such a replacement. */
abort ();
Turning off optimization allows the GTK function to compile.
$ /path-to-recent-egcs.../gcc -c gtk_button_test.i (ok)
$ /path-to-recent-egcs.../gcc -O -c gtk_button_test.i (aborts)
$ /path-to-recent-egcs.../gcc -O -c gtk_button_test.i (aborts)
I wasn't able to produce RTL output (-dp) because it was aborting
in the RTL-generation phase.
-Jamie
More information about the Gcc-bugs
mailing list