possible egcs-2.91.57 bug

Leon Avery leon@eatworms.swmed.edu
Tue Oct 27 04:02:00 GMT 1998


I think I've found a bug in egcs-2.91.57.  I will attach a gzipped
file, Talker.ii, which produces it.  Config info:

uname -a says:
    SunOS eatworms 4.1.3 14 sun4c

g++ -v says:
    Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/egcs-2.91.57/specs
    gcc version egcs-2.91.57 19980901 (egcs-1.1 release)

I did a vanilla install (configure, make, make install) and there were
no problems.

Command usually used to compile:
    g++ -g -I/home/eatworms/leon/src -I. -DHAVE_CONFIG_H  -c Talker.cc -o Talker.o

Command used to produce Talker.ii:
    g++ -g -I/home/eatworms/leon/src -I. -DHAVE_CONFIG_H -E Talker.cc > ! Talker.ii

Command used to produce assembly code:
    g++ -g Talker.ii -S

BUG DESCRIPTION:

I attach a C++ program that works properly if compiled with -g -O, but
crashes with a bus error if compiled with -g.  The crash occurs the
second time through Line 47 of Talker.cc.  The assembly code generated
in the loop of main looks, in part, like this:

    .stabn 68,0,25,LM9
    LM9:
	    !#PROLOGUE# 0
	    save %sp,-424,%sp
	    !#PROLOGUE# 1
	    mov %i0,%l0
	    call ___get_eh_context,0
	    nop
	    mov %o0,%o1
	    mov %o1,%o0
	    mov %o0,%l7

	    ...

    .stabn 68,0,47,LM29
    LM29:
	    add %l0,120,%i0
	    add %fp,-296,%o0
	    add %fp,-280,%o1
	    ld [%fp-284],%o2
	    call ___7FStringPCcUi,0
	    nop
	    add %l7,4,%o1
***	    ld [%o1],%o2

	    ...

    .stabn 68,0,57,LM35
    LM35:
    LBB10:
	    ld [%l0],%o0
	    call _fd__C3Pty,0
	    nop
	    mov %o0,%l7
	    ld [%l0],%o0
	    call _fd__C3Pty,0
	    ...

The starred line is where the SIGBUS occurs.  I think the problem here
is that %l7 is used as a temporary further down in the loop, so it's
trashed before the second time through.

Good luck, and thanks for all your effort.

-- 
Leon Avery                                       (214) 648-4931 (voice)
Department of Molecular Biology and Oncology              -1488 (fax)
University of Texas Southwestern Medical Center
5323 Harry Hines Blvd                            leon@eatworms.swmed.edu
Dallas, TX  75235-9148                  http://eatworms.swmed.edu/~leon/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Talker.ii.gz
Type: application/x-gzip
Size: 26457 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/19981027/ba2cf90d/attachment.bin>


More information about the Gcc-bugs mailing list