🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #6365

gcc 2.7.2: seg viol on combine/decl, Sun SS1, 4.1.4, SPARCworks 1.0 cc

#6365
From: Dale Carstensen
Date: Tue, 05 Dec 1995 00:00
113 lines
5013 bytes
This is a problem with gcc 2.7.2 installation.

I got a segmentation violation using stage1/cc1 compiling combine.c
in the first pass through the stage1 make, called from a csh script
that does configure, then "make LANGUAGES=c", then "make stage1", then
"make CC=\"stage1/xgcc -Bstage1/\" CFLAGS=\"-g -O\"" (and would go
on to install, etc. if the stage1 compile succeeded):

 ...
 stage1/xgcc -Bstage1/ -c  -DIN_GCC   -g -O     -I. -I. -I./config combine.c
 xgcc: Internal compiler error: program cc1 got fatal signal 11
 make: *** [combine.o] Error 1

I re-tried the last of those makes and got a bus error instead of seg viol:

 make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O"
 
 stage1/xgcc -Bstage1/ -c  -DIN_GCC   -g -O     -I. -I. -I./config combine.c
 xgcc: Internal compiler error: program cc1 got fatal signal 10
 make: *** [combine.o] Error 1

I tried compiling combine.c outside the make adding the "-v" option before
the "-Bstage1/" option, and got no error:

 stage1/xgcc -v -Bstage1/ -c -DIN_GCC -g -O -I. -I. -I./config combine.c
 Reading specs from stage1/specs
 gcc version 2.7.2
  stage1/cpp -lang-c -v -I. -I. -I./config -isystem include -isystem stage1/inclu
 de -undef -D__GNUC__=2 -D__GNUC_MINOR__=7 -Dsparc -Dsun -Dunix -D__GCC_NEW_VARAR
 GS__ -D__sparc__ -D__sun__ -D__unix__ -D__GCC_NEW_VARARGS__ -D__sparc -D__sun -D
 __unix -Asyste\
 m)unix) -Asystem(bsd) -Acpu(sparc) -Amachine(sparc) -D__OPTIMIZE__ -g -DIN_GCC c
 ombine.c /usr/tmp/cca19054.i
 GNU CPP version 2.7.2 (sparc)
 #include "..." search starts here:
 #include <...> search starts here:
  .
  .
  ./config
  include
  stage1/include
  /usr/local/include
  /usr/gnu/sparc-sun-sunos4.1.3/include
  /usr/gnu/lib/gcc-lib/sparc-sun-sunos4.1.3/2.7.2/include
  /usr/include
 End of search list.
  stage1/cc1 /usr/tmp/cca19054.i -quiet -dumpbase combine.c -g -O -version -o /us
 r/tmp/cca19054.s
 GNU C version 2.7.2 (sparc) compiled by CC.
  as -o combine.o /usr/tmp/cca19054.s

So I figured that wasn't too painful a workaround.  But now, in the cp
sub-directory, I'm getting another seg viol compiling decl.c:

 ...
 make[1]: Entering directory `/root5.3/usr/openwin/leightc/home4.1.3/local/src/gc
c-2.7.2/cp'
 stage1/xgcc -Bstage1/ -c  -DIN_GCC   -g -O     -I. -I.. -I. -I./.. -I./../config
 call.c
 stage1/xgcc -Bstage1/ -c  -DIN_GCC   -g -O     -I. -I.. -I. -I./.. -I./../config
 decl.c
 xgcc: Internal compiler error: program cc1 got fatal signal 11
 make[1]: *** [decl.o] Error 1
 make[1]: Leaving directory `/root5.3/usr/openwin/leightc/home4.1.3/local/src/gcc
 -2.7.2/cp'
 make: *** [cc1plus] Error 2

Adding the "-v" doesn't help on this one, so I brought up xxgdb to see
where the seg viol happens, and I found:

 Program received signal SIGSEGV (11), Segmentation fault
 0xd0b08 in try_combine (i3=0x359690, i2=0x359638, i1=0x0) at combine.c:2146
 
Where line 2146 of combine.c is:

 		for (link = LOG_LINKS (temp); link; link = XEXP (link, 1))

and

 (xxgdb) print link
 $3 = (struct rtx_def *) 0x80a56000
 (xxgdb) print *link
 Cannot access memory at address 0x80a56000.
 (xxgdb) where
 #0  0xd0b08 in try_combine (i3=0x359690, i2=0x359638, i1=0x0) at combine.c:2146
 #1  0xcd730 in combine_instructions (f=0x195c00, nregs=1661952) at combine.c:572
 #2  0x33e20 in rest_of_compilation (decl=0x2adc48) at toplev.c:3004
 #3  0x1d038 in finish_function (nested=0) at c-decl.c:6790
 #4  0x8bb0 in yyparse () at c-parse.y:311
 #5  0x327a8 in compile_file (name=0xf7fffa51 "/usr/tmp/cca20028.i") at toplev.c:2222
 #6  0x358a8 in main (argc=10, argv=0xf7fff98c, envp=0xf7fff9b8) at toplev.c:3908
 (xxgdb) 

I'm using GNU make 3.71, SunOS 4.1.4 on a 24 MB Sun SPARCstation-1,
the cc for the first pass is the SPARCworks 1.0 one, I think.  The
configure options are "--prefix=/usr/gnu sparc-sun-sunos4.1.3".

That's about all I can think of to include.  I may try building 2.7.2
using gcc 2.6.0 instead of cc from SPARCworks 1.0, or using cc from
SPARCworks 2.0.1, or building 2.7.1, I guess.  Probably not all that
soon, but I may ftp 2.7.1 soon, or the diff and try to back out the
diff from 2.7.2 to get 2.7.1.

If there's a way to tell what line of decl.c cc1 is processing, let
me know, and I'll find that, too.  Or any other further info you
need.

Thanks.

  Mr Dale Carstensen
  LAMP, Inc.                   office (505)662-2524 pager (505)988-0736
  1504 S Sage                  home   (505)662-3691
  Los Alamos, NM 87545-3037    dlc@lampinc.com
Technical Details
Message-ID: <199512051823.LAA23181@leight.lampinc.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,c264cd6f57afd477,start
X-Google-Attributes: gid113d02,public
From: dlc@lampinc.com (Dale Carstensen)
Subject: gcc 2.7.2: seg viol on combine/decl, Sun SS1, 4.1.4, SPARCworks 1.0 cc
Date: 1995/12/05
Message-ID: <199512051823.LAA23181@leight.lampinc.com>
X-Deja-AN: 120945678
distribution: gnu
sender: daemon@cis.ohio-state.edu
organization: GNUs Not Usenet
newsgroups: gnu.gcc.bug