egcs/Solaris status

Dimitri PAPADOPOULOS-ORFANOS papadopo@shfj.cea.fr
Mon Aug 23 06:10:00 GMT 1999


Jerffery A Law wrote:
> In message < 37BEC99E.9BCE3572@club-internet.fr >you write:
>   > 1) GCC does not bootstrap with Sun's fully patched C compiler 5.0.
>   >    This may be a problem with Sun's compiler, but I doubt it.
>   >    In fact 'make bootstrap' will usually fail whatever the compiler used
>   >    to bootstrap. See my messsage to this list:
>   >     GCC 2.95.1 'make bootstrap' oddities on Solaris
> Is this a comparison failure?  If so, it is a bug in the Solaris 5.0 
compilers.

No, this is not a comparison failure, but it could well be a bug in the
Solaris 5.0 compiler. I tried to build GCC with a fully patched Sun C
compiler once again. Here are the results:

$ uname -a
SunOS orcanie 5.7 Generic sun4u sparc SUNW,Ultra-30
$ where as ld cc
/usr/ccs/bin/as
/usr/ccs/bin/ld
/opt/SUNWspro/bin/cc
$ where gcc
gcc: Command not found.
$ ./configure --enable-shared --enable-threads
Configuring for a sparc-sun-solaris2.7 host.
[...]
checking for gcc... cc
checking whether we are using GNU C... no
[...]
$ make bootstrap
[...]
stage1/xgcc -Bstage1/ -B/pub_dom/gcc-2.95.1/sparc-sun-solaris2.7/bin/  -DIN_GCC 
-DHAIFA  -DSVR4  -O2 -g  -DHAVE_CONFIG_H  -o genpeep \
 genpeep.o rtl.o bitmap.o print-rtl.o ` case "obstack.o" in ?*) echo obstack.o 
;; esac ` ` case "alloca.o" in ?*) echo alloca.o ;; esac ` ` case "" in ?*) echo 
 ;; esac `  ` case "" in ?*) echo  ;; esac ` ` case "" in ?*) echo  ;; esac ` 
./genpeep ./config/sparc/sparc.md > tmp-peep.c
Segmentation Fault
make[2]: *** [s-peep] Error 139
make[2]: Leaving directory `/home/papadopo/gcc-2.95.1/gcc'
make[1]: *** [bootstrap] Error 2
make[1]: Leaving directory `/home/papadopo/gcc-2.95.1/gcc'
make: *** [bootstrap] Error 2
$ 


Then I tried this:

$ cd gcc
$ gdb ./genpeep
GNU gdb 4.17
[...]
This GDB was configured as "sparc-sun-solaris2.5.1"...
Breakpoint 1 at 0x2780c
Breakpoint 2 at 0x11404: file ./genpeep.c, line 440.
Breakpoint 3 at 0x27854
(gdb) set args ./config/sparc/sparc.md
(gdb) run
Starting program: /home/papadopo/gcc-2.95.1/gcc/./genpeep 
./config/sparc/sparc.md
Breakpoint 1 at 0xff31680c
Breakpoint 3 at 0xff2b91e0

Program received signal SIGSEGV, Segmentation fault.
0xff2b6c5c in strlen ()
(gdb) where
#0  0xff2b6c5c in strlen ()
#1  0x12bf8 in init_rtl () at rtl.c:910
#2  0x11490 in main (argc=2, argv=0x26c00) at ./genpeep.c:466
(gdb) 


The problem is in init_rtl () at rtl.c:910 where
	rtx_length[i] = strlen (rtx_format[i]);
but i is 126 and 'rtx_format[i]' is 0x0.

I can't see no reason for 'rtx_format[i]' being 0x0: file 'rtl.def'
contains 127 occurences of DEF_RTL_EXPR and thus defines 'rtx_code[i]'
for values from 0 to 126 included. Also, I checked in object files
that the value of enum LAST_AND_UNUSED_RTX_CODE is 127.

Then 'rtx-format' array is initialised with
char *rtx_format[] = {
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)   FORMAT ,
#include "rtl.def"		/* rtl expressions are defined here */
#undef DEF_RTL_EXPR
};

A bug in the Sun C compiler? I can't reproduce in a small piece code.
If anyone has ideas, I am willing to perform further checks on our
Solaris machine.

--
Dimitri Papadopoulos



More information about the Gcc mailing list