This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

new SIGSEGV in jump.c


Hi,

I just tried to rebuild egcs with thischange to jump.c:

Mon Jul  6 10:42:05 1998  Mark Mitchell  <mark@markmitchell.com>

        * jump.c (duplicate_loop_exit_test): Don't refuse to copy a
        section of code just because it contains
        NOTE_INSN_BLOCK_{BEG,END}.
        * stmt.c (expand_end_loop): Likewise.  Also, don't refuse to
        move CALL_INSNs or CODE_LABELs.  When moving code, don't move
        NOTE_INSN_BLOCK_{BEG,END}.

On powerpc-unknown-linux-gnu the freshly built cc1 segfaults then while
compiling libgcc/_bb:

(xxgdb)  r -g -O2 -fPIC  libgcc2.i -o _bb.o
Program received signal SIGSEGV, Segmentation fault.
0x18d251c in duplicate_loop_exit_test (loop_start=0x1b2cba0) at ../../../egcs/gcc/jump.c:2440

(xxgdb) bt
#0  0x18d251c in duplicate_loop_exit_test (loop_start=0x1b2cba0) at ../../../egcs/gcc/jump.c:2440
#1  0x18d05f0 in jump_optimize (f=0x1b2aa18, cross_jump=28500056, noop_moves=28494656, after_regscan=1) at ../../../egcs/gcc/jump.c:631
#2  0x18274f4 in rest_of_compilation (decl=0x1b28fc8) at ../../../egcs/gcc/toplev.c:3266
#3  0x1812634 in finish_function (nested=0) at ../../../egcs/gcc/c-decl.c:7165
#4  0x18015d4 in yyparse () at c-parse.y:312
#5  0x1826388 in compile_file (name=0x249f0 <Address 0x249f0 out of bounds>) at ../../../egcs/gcc/toplev.c:2597
#6  0x182958c in main (argc=8, argv=0x7ffffc24, envp=0x84) at ../../../egcs/gcc/toplev.c:4453
#7  0x16e4ee4 in __libc_start_main ()

->    if (GET_CODE (insn) == INSN
	&& (set = single_set (insn)) != 0
	&& ((reg = SET_DEST (set), GET_CODE (reg) == REG)
	  || (GET_CODE (reg) == SUBREG
	    && (reg = SUBREG_REG (reg), GET_CODE (reg) == REG)))
	&& REGNO (reg) >= FIRST_PSEUDO_REGISTER
	&& REGNO_FIRST_UID (REGNO (reg)) == INSN_UID (insn))

(xxgdb) print insn
$2 = 0x1c2c528
(xxgdb) pr
(insn 177 52 178 (set (reg:CCUNS 123)
(compare:CCUNS (reg/s:SI 92)
(const_int 5))) -1 (nil)
(nil))

(xxgdb) pi
$3 = {0xb1, 0x1c2d608, 0x1c2c568, 0x1c2c518, 0xffffffff, 0x0, 0x0}

If I interpret the assembler correctly the NULL pointer dereference happens
here:    
  && REGNO_FIRST_UID (REGNO (reg)) == INSN_UID (insn))

If I should execute other debug macros, please tell me. I simply don't know
what these do.

Backing out the patch solves this problem. Mark already looked at this, but
could find nothing suspicious.

Franz.

PS: the compiler used for building is  egcs-2.91.45 19980704.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]