Internal compiler error: program cc1 got fatal signal 4 building egcs-1.1a for vax-dec-ultrix4.3

John David Anglin dave@hiauly1.hia.nrc.ca
Wed Sep 9 10:28:00 GMT 1998


The build fails with the following error:

...
cat ../../gcc/sys-types.h ../../gcc/sys-protos.h > SYSCALLS.c
./xgcc -B./  -DIN_GCC    -g -O3 -save-temps -I./include     -I. -I../../gcc -I../../gcc/config \
  -aux-info SYSCALLS.c.X -S -o tmp-SYSCALLS.s SYSCALLS.c
xgcc: Internal compiler error: program cc1 got fatal signal 4
make: *** [SYSCALLS.c.X] Error 1

Here is some information about the error:

# gdb -c core cc1
GNU gdb 4.17
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "vax-dec-ultrix4.3"...
Core was generated by `cc1'.
#0  0x3a52e in fixup_unsigned_type (type=0x111468, 1119336)
    at ../../gcc/stor-layout.c:1248
1248      TYPE_MAX_VALUE (type)
Breakpoint 1 at 0xf315a
Breakpoint 2 at 0xf163d
Breakpoint 3 at 0x308e4: file ../../gcc/toplev.c, line 2114
(gdb) bt
#0  0x3a52e in fixup_unsigned_type (type=0x111468)
    at ../../gcc/stor-layout.c:1248
#1  0x3a31b in make_unsigned_type (precision=128)
    at ../../gcc/stor-layout.c:1148
#2  0xfdb3 in init_decl_processing () at ../../gcc/c-decl.c:3056
#3  0x29dd6 in compile_file (name=0x7fffc0da "SYSCALLS.i")
    at ../../gcc/toplev.c:2552
#4  0x2fd93 in main (argc=13, argv=0x7fffc008, envp=0x7fffc040)
    at ../../gcc/toplev.c:4838
(gdb) info reg
r0             0xffffffc0       -64
r1             0xffffffff       -1
r2             0x111460 1119328
r3             0x1114c8 1119432
r4             0x0      0
r5             0x80     128
r6             0x80     128
r7             0x35b14  219924
r8             0xf77f0  1013744
r9             0x3a234  238132
r10            0x3a2ee  238318
r11            0xf77ec  1013740
ap             0x7fffbf00       2147467008
fp             0x7fffbee8       2147466984
sp             0x7fffbee8       2147466984
pc             0x3a52e  238894
ps             0x3c00001        62914561
(gdb) print precision
$1 = 128
(gdb) disass fixup_unsigned_type
Dump of assembler code for function fixup_unsigned_type:
0x3a4fc <fixup_unsigned_type+2>:        movl 4(ap),r0
0x3a500 <fixup_unsigned_type+6>:        movzbl 32(r0),r6
0x3a504 <fixup_unsigned_type+10>:       clrf -(sp)
0x3a506 <fixup_unsigned_type+12>:       clrf -(sp)
0x3a508 <fixup_unsigned_type+14>:       calls $2,0x35886 <build_int_2_wide>
0x3a50f <fixup_unsigned_type+21>:       movl 4(ap),r1
0x3a513 <fixup_unsigned_type+25>:       movl r0,56(r1)
0x3a517 <fixup_unsigned_type+29>:       subl3 $32,r6,r0
0x3a51b <fixup_unsigned_type+33>:       tstl r0
0x3a51d <fixup_unsigned_type+35>:       bleq 0x3a535
0x3a51f <fixup_unsigned_type+37>:       subl3 r6,#64,r0
0x3a527 <fixup_unsigned_type+45>:       mcoml $0,r1
0x3a52a <fixup_unsigned_type+48>:       subb3 r0,$32,r2
0x3a52e <fixup_unsigned_type+52>:       extzv r0,r2,r1,r0
0x3a533 <fixup_unsigned_type+57>:       brb 0x3a537
0x3a535 <fixup_unsigned_type+59>:       clrf r0
0x3a537 <fixup_unsigned_type+61>:       pushl r0
0x3a539 <fixup_unsigned_type+63>:       subl3 $32,r6,r0
0x3a53d <fixup_unsigned_type+67>:       tstl r0
0x3a53f <fixup_unsigned_type+69>:       bgeq 0x3a549
0x3a541 <fixup_unsigned_type+71>:       ashl r6,$1,r0
0x3a545 <fixup_unsigned_type+75>:       decl r0
---Type <return> to continue, or q <return> to quit---qQuit
(gdb) list fixup_unsigned_type
1239       and for enumeral types.  */
1240
1241    void
1242    fixup_unsigned_type (type)
1243         tree type;
1244    {
1245      register int precision = TYPE_PRECISION (type);
1246
1247      TYPE_MIN_VALUE (type) = build_int_2 (0, 0);
1248      TYPE_MAX_VALUE (type)
(gdb) 
1249        = build_int_2 (precision - HOST_BITS_PER_WIDE_INT >= 0
1250                       ? -1 : ((HOST_WIDE_INT) 1 << precision) - 1,
1251                       precision - HOST_BITS_PER_WIDE_INT > 0
1252                       ? ((unsigned HOST_WIDE_INT) ~0
1253                          >> (HOST_BITS_PER_WIDE_INT
1254                              - (precision - HOST_BITS_PER_WIDE_INT)))
1255                       : 0);
1256      TREE_TYPE (TYPE_MIN_VALUE (type)) = type;
1257      TREE_TYPE (TYPE_MAX_VALUE (type)) = type;
1258

The exception occurs in the extzv r0,r2,r1,r0 instruction.  As can be
seen, the right-shift expression in lines 1252 and 1254 evaluates to
-64 bits (32 - (128 - 32)).  The behaviour of the right shift operator
is undefined when the right operand is negative or greater than equal
to the number of value and sign bits in the object representation of
the promoted left operand.

It looks like there should be a test to see if
HOST_BITS_PER_WIDE_INT - (precision - HOST_BITS_PER_WIDE_INT) is
>= 0.

-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)



More information about the Gcc-bugs mailing list