* gcc failed to bootstrap on Linux/mipsel @ 2002-01-27 17:36 H . J . Lu 2002-01-28 12:47 ` H . J . Lu 0 siblings, 1 reply; 20+ messages in thread From: H . J . Lu @ 2002-01-27 17:36 UTC (permalink / raw) To: gcc-patches On Linux/mipsel, as of Sun Jan 27 11:10:21 PST 2002, I got ./xgcc -B./ -B/usr/gcc-3.1/mipsel-pc-linux-gnu/bin/ -isystem /usr/gcc-3.1/mipsel-pc-linux-gnu/include -isystem /usr/gcc-3.1/mipsel-pc-linux-gnu/sys-include -dumpspecs > tmp-specs make[4]: *** [specs] Error 139 make[4]: Leaving directory `/export/build/gnu/gcc-mips/build-mipsel-linux/gcc' make[3]: *** [stage2_build] Error 2 make[3]: Leaving directory `/export/build/gnu/gcc-mips/build-mipsel-linux/gcc' make[2]: *** [bootstrap] Error 2 The last good one for me is Jan 24 16:56 PST 2002. I am tracking down which patch breaks Linux/mipsel now. Irix6.5/mips seems ok. It may be another ABI/ednian bug. H.J. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-27 17:36 gcc failed to bootstrap on Linux/mipsel H . J . Lu @ 2002-01-28 12:47 ` H . J . Lu 2002-01-28 13:01 ` Richard Henderson 0 siblings, 1 reply; 20+ messages in thread From: H . J . Lu @ 2002-01-28 12:47 UTC (permalink / raw) To: gcc-patches; +Cc: rth On Sun, Jan 27, 2002 at 05:34:41PM -0800, H . J . Lu wrote: > On Linux/mipsel, as of Sun Jan 27 11:10:21 PST 2002, I got > > ./xgcc -B./ -B/usr/gcc-3.1/mipsel-pc-linux-gnu/bin/ -isystem > /usr/gcc-3.1/mipsel-pc-linux-gnu/include -isystem > /usr/gcc-3.1/mipsel-pc-linux-gnu/sys-include -dumpspecs > tmp-specs > make[4]: *** [specs] Error 139 > make[4]: Leaving directory `/export/build/gnu/gcc-mips/build-mipsel-linux/gcc' > make[3]: *** [stage2_build] Error 2 > make[3]: Leaving directory `/export/build/gnu/gcc-mips/build-mipsel-linux/gcc' > make[2]: *** [bootstrap] Error 2 > > The last good one for me is Jan 24 16:56 PST 2002. I am tracking down > which patch breaks Linux/mipsel now. Irix6.5/mips seems ok. It may be > another ABI/ednian bug. I got: GOOD: Jan 26 20:30 PST 2002 BAD: Jan 27 10:00 PST 2002 The only relevant change is http://gcc.gnu.org/ml/gcc-patches/2002-01/msg01929.html Richard, could you please take a look at it? Thanks. H.J. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-28 12:47 ` H . J . Lu @ 2002-01-28 13:01 ` Richard Henderson 2002-01-29 23:37 ` H . J . Lu 0 siblings, 1 reply; 20+ messages in thread From: Richard Henderson @ 2002-01-28 13:01 UTC (permalink / raw) To: H . J . Lu; +Cc: gcc-patches On Mon, Jan 28, 2002 at 12:39:00PM -0800, H . J . Lu wrote: > I got: > > GOOD: Jan 26 20:30 PST 2002 > BAD: Jan 27 10:00 PST 2002 > > The only relevant change is > > http://gcc.gnu.org/ml/gcc-patches/2002-01/msg01929.html > > Richard, could you please take a look at it? As usual: Are you give me any more information than this? Like finding the miscompiled file or function? Otherwise I can't help you. r~ ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-28 13:01 ` Richard Henderson @ 2002-01-29 23:37 ` H . J . Lu 2002-01-30 0:36 ` H . J . Lu 0 siblings, 1 reply; 20+ messages in thread From: H . J . Lu @ 2002-01-29 23:37 UTC (permalink / raw) To: Richard Henderson, gcc-patches On Mon, Jan 28, 2002 at 12:52:50PM -0800, Richard Henderson wrote: > On Mon, Jan 28, 2002 at 12:39:00PM -0800, H . J . Lu wrote: > > I got: > > > > GOOD: Jan 26 20:30 PST 2002 > > BAD: Jan 27 10:00 PST 2002 > > > > The only relevant change is > > > > http://gcc.gnu.org/ml/gcc-patches/2002-01/msg01929.html > > > > Richard, could you please take a look at it? > > As usual: > > Are you give me any more information than this? Like finding > the miscompiled file or function? Otherwise I can't help you. I only have a very slow mips box. You may know, it only failed when bootstrapping on Linux/mipsel. It will take some time to track down which files are miscompiled. But I have to fix other Linux/mips bugs first :-). I only have a semi-automatic setup for bootstrapping gcc on Linux/mips. I don't have the resources to do more in a timely manner. But I want to inform everyone as soon as I can when a patch breaks Linux/mips. H.J. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-29 23:37 ` H . J . Lu @ 2002-01-30 0:36 ` H . J . Lu 2002-01-30 0:40 ` Richard Henderson 0 siblings, 1 reply; 20+ messages in thread From: H . J . Lu @ 2002-01-30 0:36 UTC (permalink / raw) To: Richard Henderson, gcc-patches On Tue, Jan 29, 2002 at 11:09:07PM -0800, H . J . Lu wrote: > On Mon, Jan 28, 2002 at 12:52:50PM -0800, Richard Henderson wrote: > > On Mon, Jan 28, 2002 at 12:39:00PM -0800, H . J . Lu wrote: > > > I got: > > > > > > GOOD: Jan 26 20:30 PST 2002 > > > BAD: Jan 27 10:00 PST 2002 > > > > > > The only relevant change is > > > > > > http://gcc.gnu.org/ml/gcc-patches/2002-01/msg01929.html > > > > > > Richard, could you please take a look at it? > > > > As usual: > > > > Are you give me any more information than this? Like finding > > the miscompiled file or function? Otherwise I can't help you. > > I only have a very slow mips box. You may know, it only failed when > bootstrapping on Linux/mipsel. It will take some time to track down > which files are miscompiled. But I have to fix other Linux/mips bugs > first :-). Richarrd, almost every single file in gcc is miscompiled by your change. ../../../gcc-mips/build-mipsel-rearden-linux/gcc/asm/cppinit.s is the good one and asm/cppinit.s is the bad one. # gdb cc1 (gdb) r -v Starting program: /export/build/gnu/gcc/build-mipsel-linux/gcc/cc1 -v GNU CPP version 3.1 20020127 (experimental) (cpplib) (MIPSel GNU/Linux with ELF) Program received signal SIGSEGV, Segmentation fault. 0x00479f34 in init_standard_includes (pfile=0x100744b0) at /home/hjl/work/gnu/src/gcc/gcc/gcc/cppinit.c:793 793 GET_ENV_PATH_LIST (path, "CPATH"); (gdb) bt #0 0x00479f34 in init_standard_includes (pfile=0x100744b0) at /home/hjl/work/gnu/src/gcc/gcc/gcc/cppinit.c:793 #1 0x0047a6d0 in cpp_read_main_file (pfile=0x100744b0, fname=0x78fc5c "", table=0x3) at /home/hjl/work/gnu/src/gcc/gcc/gcc/cppinit.c:919 #2 0x00426dd0 in init_c_lex (filename=0x78fc5c "") at /home/hjl/work/gnu/src/gcc/gcc/gcc/c-lex.c:149 #3 0x0045dd74 in c_common_init (filename=0x0) at /home/hjl/work/gnu/src/gcc/gcc/gcc/c-common.c:4041 #4 0x00466c3c in c_objc_common_init (filename=0x0) at /home/hjl/work/gnu/src/gcc/gcc/gcc/c-objc-common.c:211 #5 0x00424340 in c_init ( filename=0x7fff7f9a "/export/build/gnu/gcc/build-mipsel-linux/gcc/cc1") at /home/hjl/work/gnu/src/gcc/gcc/gcc/c-lang.c:91 #6 0x0066358c in lang_dependent_init (name=0x7fff7a34 ".{ÿ\177_{ÿ\177") at /home/hjl/work/gnu/src/gcc/gcc/gcc/toplev.c:5067 #7 0x00663abc in do_compile () at /home/hjl/work/gnu/src/gcc/gcc/gcc/toplev.c:5176 #8 0x00663c68 in toplev_main (argc=2, argv=0x7fff7a34) at /home/hjl/work/gnu/src/gcc/gcc/gcc/toplev.c:5209 #9 0x0047ee7c in main (argc=2147450778, argv=0x79ad96) at /home/hjl/work/gnu/src/gcc/gcc/gcc/main.c:35 (gdb) p/x $pc $3 = 0x479f34 (gdb) p/x $s8 $4 = 0x0 0x479f20 <init_standard_includes+88>: nop 0x479f24 <init_standard_includes+92>: lw t9,-22896(gp) 0x479f28 <init_standard_includes+96>: nop 0x479f2c <init_standard_includes+100>: jalr t9 0x479f30 <init_standard_includes+104>: nop 0x479f34 <init_standard_includes+108>: lw gp,16(s8) 0x479f38 <init_standard_includes+112>: nop 0x479f3c <init_standard_includes+116>: move s8,sp I hope it is enough for you to fix the breakage. Thanks. H.J. ---- diff -upr ../../../gcc-mips/build-mipsel-rearden-linux/gcc/asm/cppinit.s asm/cppinit.s --- ../../../gcc-mips/build-mipsel-rearden-linux/gcc/asm/cppinit.s Wed Jan 30 00:00:53 2002 +++ asm/cppinit.s Tue Jan 29 23:59:57 2002 @@ -2,7 +2,7 @@ .section .mdebug.abi32 .previous .abicalls - .stabs "/export/build/gnu/gcc-mips/build-mipsel-rearden-linux/gcc/",100,0,0,$Ltext0 + .stabs "/export/build/gnu/gcc/build-mipsel-rearden-linux/gcc/",100,0,0,$Ltext0 .stabs "/home/hjl/work/gnu/src/gcc/gcc/gcc/cppinit.c",100,0,0,$Ltext0 .text $Ltext0: @@ -1382,10 +1382,10 @@ $LM70: .stabn 68,0,291,$LM71-remove_dup_dir $LM71: $LBE6: - lw $31,36($sp) move $2,$17 - lw $16,24($sp) + lw $31,36($sp) lw $17,28($sp) + lw $16,24($sp) #nop .set noreorder .set nomacro @@ -2016,8 +2016,8 @@ $LM127: sw $31,36($sp) sw $17,28($sp) sw $16,24($sp) - sw $28,32($sp) move $17,$4 + sw $28,32($sp) .stabn 68,0,483,$LM128-cpp_create_reader $LM128: $LBB12: @@ -2194,8 +2194,8 @@ $LM178: .stabn 68,0,536,$LM179-cpp_create_reader $LM179: $LBE12: - lw $31,36($sp) move $2,$16 + lw $31,36($sp) lw $17,28($sp) lw $16,24($sp) #nop @@ -2417,8 +2417,8 @@ $LM215: .stabn 68,0,596,$LM216-cpp_destroy $LM216: $LBE13: - lw $31,44($sp) move $2,$16 + lw $31,44($sp) lw $19,36($sp) lw $18,32($sp) lw $17,28($sp) @@ -3265,16 +3265,16 @@ $LBB21: .stabn 68,0,793,$LM261-init_standard_includes $LM261: la $4,$LC48 - .stabn 68,0,782,$LM262-init_standard_includes + .stabn 68,0,785,$LM262-init_standard_includes $LM262: - move $fp,$sp - .stabn 68,0,785,$LM263-init_standard_includes -$LM263: lw $22,396($19) - .stabn 68,0,793,$LM264-init_standard_includes -$LM264: + .stabn 68,0,793,$LM263-init_standard_includes +$LM263: la $25,getenv jal $31,$25 + .stabn 68,0,782,$LM264-init_standard_includes +$LM264: + move $fp,$sp .stabn 68,0,794,$LM265-init_standard_includes $LM265: .set noreorder @@ -3419,37 +3419,41 @@ $LBB23: srl $2,$2,3 sll $2,$2,3 subu $sp,$sp,$2 - addu $21,$sp,16 .stabn 68,0,823,$LM275-init_standard_includes $LM275: move $4,$22 + .stabn 68,0,822,$LM276-init_standard_includes +$LM276: + addu $21,$sp,16 + .stabn 68,0,823,$LM277-init_standard_includes +$LM277: la $25,strlen jal $31,$25 - .stabn 68,0,825,$LM276-init_standard_includes -$LM276: + .stabn 68,0,825,$LM278-init_standard_includes +$LM278: la $5,cpp_GCC_INCLUDE_DIR move $4,$21 move $6,$20 - .stabn 68,0,823,$LM277-init_standard_includes -$LM277: + .stabn 68,0,823,$LM279-init_standard_includes +$LM279: move $23,$2 - .stabn 68,0,825,$LM278-init_standard_includes -$LM278: + .stabn 68,0,825,$LM280-init_standard_includes +$LM280: la $25,memcpy jal $31,$25 - .stabn 68,0,826,$LM279-init_standard_includes -$LM279: + .stabn 68,0,826,$LM281-init_standard_includes +$LM281: addu $2,$21,$20 sb $0,0($2) - .stabn 68,0,828,$LM280-init_standard_includes -$LM280: + .stabn 68,0,828,$LM282-init_standard_includes +$LM282: la $18,cpp_include_defaults lw $2,0($18) #nop beq $2,$0,$L209 $L185: - .stabn 68,0,831,$LM281-init_standard_includes -$LM281: + .stabn 68,0,831,$LM283-init_standard_includes +$LM283: lw $2,8($18) move $5,$21 .set noreorder @@ -3466,14 +3470,14 @@ $LM281: #nop bne $2,$0,$L184 $L187: - .stabn 68,0,836,$LM282-init_standard_includes -$LM282: + .stabn 68,0,836,$LM284-init_standard_includes +$LM284: lw $4,0($18) la $25,memcmp jal $31,$25 beq $2,$0,$L207 - .stabn 68,0,828,$LM283-init_standard_includes -$LM283: + .stabn 68,0,828,$LM285-init_standard_includes +$LM285: $L184: addu $18,$18,16 $L208: @@ -3481,44 +3485,44 @@ $L208: #nop bne $2,$0,$L185 j $L181 - .stabn 68,0,839,$LM284-init_standard_includes -$LM284: + .stabn 68,0,839,$LM286-init_standard_includes +$LM286: $L207: $LBB24: lw $4,0($18) la $25,strlen jal $31,$25 - .stabn 68,0,840,$LM285-init_standard_includes -$LM285: + .stabn 68,0,840,$LM287-init_standard_includes +$LM287: addu $4,$23,$2 subu $4,$4,$20 - .stabn 68,0,841,$LM286-init_standard_includes -$LM286: - addu $4,$4,1 - .stabn 68,0,839,$LM287-init_standard_includes -$LM287: - move $16,$2 .stabn 68,0,841,$LM288-init_standard_includes $LM288: + addu $4,$4,1 + .stabn 68,0,839,$LM289-init_standard_includes +$LM289: + move $16,$2 + .stabn 68,0,841,$LM290-init_standard_includes +$LM290: la $25,xmalloc jal $31,$25 - .stabn 68,0,842,$LM289-init_standard_includes -$LM289: + .stabn 68,0,842,$LM291-init_standard_includes +$LM291: move $4,$2 move $5,$22 move $6,$23 - .stabn 68,0,841,$LM290-init_standard_includes -$LM290: + .stabn 68,0,841,$LM292-init_standard_includes +$LM292: move $17,$2 - .stabn 68,0,843,$LM291-init_standard_includes -$LM291: + .stabn 68,0,843,$LM293-init_standard_includes +$LM293: subu $16,$16,$20 - .stabn 68,0,842,$LM292-init_standard_includes -$LM292: + .stabn 68,0,842,$LM294-init_standard_includes +$LM294: la $25,memcpy jal $31,$25 - .stabn 68,0,843,$LM293-init_standard_includes -$LM293: + .stabn 68,0,843,$LM295-init_standard_includes +$LM295: lw $5,0($18) addu $16,$16,1 addu $5,$5,$20 @@ -3526,8 +3530,8 @@ $LM293: move $6,$16 la $25,memcpy jal $31,$25 - .stabn 68,0,847,$LM294-init_standard_includes -$LM294: + .stabn 68,0,847,$LM296-init_standard_includes +$LM296: lw $7,12($18) move $4,$19 move $5,$17 @@ -3541,8 +3545,8 @@ $LM294: .set macro .set reorder - .stabn 68,0,813,$LM295-init_standard_includes -$LM295: + .stabn 68,0,813,$LM297-init_standard_includes +$LM297: $L205: $LBE24: $LBE23: @@ -3552,8 +3556,8 @@ $LBE23: jal $31,$25 j $L180 $L175: - .stabn 68,0,809,$LM296-init_standard_includes -$LM296: + .stabn 68,0,809,$LM298-init_standard_includes +$LM298: la $4,$LC52 $L202: la $25,getenv @@ -3566,29 +3570,29 @@ $L202: .set reorder $L173: - .stabn 68,0,806,$LM297-init_standard_includes -$LM297: + .stabn 68,0,806,$LM299-init_standard_includes +$LM299: la $4,$LC51 - .stabn 68,0,807,$LM298-init_standard_includes -$LM298: + .stabn 68,0,807,$LM300-init_standard_includes +$LM300: j $L202 $L204: bne $4,$0,$L168 - .stabn 68,0,800,$LM299-init_standard_includes -$LM299: + .stabn 68,0,800,$LM301-init_standard_includes +$LM301: la $4,$LC49 - .stabn 68,0,801,$LM300-init_standard_includes -$LM300: + .stabn 68,0,801,$LM302-init_standard_includes +$LM302: j $L202 $L171: - .stabn 68,0,803,$LM301-init_standard_includes -$LM301: + .stabn 68,0,803,$LM303-init_standard_includes +$LM303: la $4,$LC50 - .stabn 68,0,804,$LM302-init_standard_includes -$LM302: + .stabn 68,0,804,$LM304-init_standard_includes +$LM304: j $L202 - .stabn 68,0,795,$LM303-init_standard_includes -$LM303: + .stabn 68,0,795,$LM305-init_standard_includes +$LM305: $L203: move $5,$16 move $6,$0 ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-30 0:36 ` H . J . Lu @ 2002-01-30 0:40 ` Richard Henderson 2002-01-30 9:29 ` H . J . Lu 0 siblings, 1 reply; 20+ messages in thread From: Richard Henderson @ 2002-01-30 0:40 UTC (permalink / raw) To: H . J . Lu; +Cc: gcc-patches On Wed, Jan 30, 2002 at 12:23:23AM -0800, H . J . Lu wrote: > Richarrd, almost every single file in gcc is miscompiled by your change. "Different" != "miscompiled". There were zero functional changes in the diff you posted. The breakage is elsewhere. r~ ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-30 0:40 ` Richard Henderson @ 2002-01-30 9:29 ` H . J . Lu 2002-01-30 10:09 ` Richard Henderson 0 siblings, 1 reply; 20+ messages in thread From: H . J . Lu @ 2002-01-30 9:29 UTC (permalink / raw) To: Richard Henderson, gcc-patches On Wed, Jan 30, 2002 at 12:36:22AM -0800, Richard Henderson wrote: > On Wed, Jan 30, 2002 at 12:23:23AM -0800, H . J . Lu wrote: > > Richarrd, almost every single file in gcc is miscompiled by your change. > > "Different" != "miscompiled". There were zero functional changes It is miscompiled. > in the diff you posted. The breakage is elsewhere. Please read http://gcc.gnu.org/ml/gcc-patches/2002-01/msg02117.html one more time. The good init_standard_includes has .frame $fp,72,$31 ... move $fp,$sp ... la $25,getenv jal $31,$25 But with your change, it becomes .frame $fp,72,$31 ... la $25,getenv jal $31,$25 ... move $fp,$sp The o32 assmebler has to turn la $25,getenv jal $31,$25 into la $25,getenv jal $31,$25 lw gp,16(frame_register) That is why it failed at 0x479f34 <init_standard_includes+108>: lw gp,16(s8) since you moved the initialization of s8/fp after "jal". That is a very bad idea. You have to set the frame register before making any external calls so that the assembler can restore gp after the function return. Could you please fix your change? Thanks. H.J. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-30 9:29 ` H . J . Lu @ 2002-01-30 10:09 ` Richard Henderson 0 siblings, 0 replies; 20+ messages in thread From: Richard Henderson @ 2002-01-30 10:09 UTC (permalink / raw) To: H . J . Lu; +Cc: gcc-patches On Wed, Jan 30, 2002 at 09:05:55AM -0800, H . J . Lu wrote: > The o32 assmebler has to turn > > la $25,getenv > jal $31,$25 > > into > la $25,getenv > jal $31,$25 > lw gp,16(frame_register) > > That is why it failed at > > 0x479f34 <init_standard_includes+108>: lw gp,16(s8) > > since you moved the initialization of s8/fp after "jal". If you knew what the problem was, why didn't you say so rather than make me guess? Fixed. r~ * sched-deps.c (sched_analyze): Make a call read the frame pointer. Index: sched-deps.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/sched-deps.c,v retrieving revision 1.32 diff -c -p -d -r1.32 sched-deps.c *** sched-deps.c 2002/01/29 22:11:08 1.32 --- sched-deps.c 2002/01/30 18:03:14 *************** sched_analyze (deps, head, tail) *** 1267,1286 **** } else { - /* A call may read and modify global register variables. - Other call-clobbered hard regs may be clobbered. We - don't know what set of fixed registers might be used - by the function. It is certain that the stack pointer - is among them, but be conservative. */ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) if (global_regs[i]) { SET_REGNO_REG_SET (reg_pending_sets, i); SET_REGNO_REG_SET (reg_pending_uses, i); } else if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)) SET_REGNO_REG_SET (reg_pending_clobbers, i); else if (fixed_regs[i]) SET_REGNO_REG_SET (reg_pending_uses, i); } --- 1267,1295 ---- } else { for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) + /* A call may read and modify global register variables. */ if (global_regs[i]) { SET_REGNO_REG_SET (reg_pending_sets, i); SET_REGNO_REG_SET (reg_pending_uses, i); } + /* Other call-clobbered hard regs may be clobbered. */ else if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)) SET_REGNO_REG_SET (reg_pending_clobbers, i); + /* We don't know what set of fixed registers might be used + by the function, but it is certain that the stack pointer + is among them, but be conservative. */ else if (fixed_regs[i]) + SET_REGNO_REG_SET (reg_pending_uses, i); + /* The frame pointer is normally not used by the function + itself, but by the debugger. */ + /* ??? MIPS o32 is an exception. It uses the frame pointer + in the macro expansion of jal but does not represent this + fact in the call_insn rtl. */ + else if (i == FRAME_POINTER_REGNUM + || (i == HARD_FRAME_POINTER_REGNUM + && (! reload_completed || frame_pointer_needed))) SET_REGNO_REG_SET (reg_pending_uses, i); } ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel
@ 2002-01-27 19:41 John David Anglin
2002-01-27 22:45 ` H . J . Lu
2002-01-28 7:27 ` Geoff Keating
0 siblings, 2 replies; 20+ messages in thread
From: John David Anglin @ 2002-01-27 19:41 UTC (permalink / raw)
To: gcc-patches; +Cc: hjl
> The last good one for me is Jan 24 16:56 PST 2002. I am tracking down
> which patch breaks Linux/mipsel now. Irix6.5/mips seems ok. It may be
> another ABI/ednian bug.
I am seeing increased testsuite failures on hppa2.0w-hp-hpux11.11 as of
Jan. 26 09:10:13 UTC. My last good build was as of Jan. 25 05:05:05 UTC.
I have looked at one of the new failure (g++.abi/cxa_vec.C). The failure
appears to be a new bug in the loop pass. After every call on the PA,
the pic offset table register needs to be restored. For some reason,
the loop pass pulled the insn doing this restore out of the loop, apparently
ignoring an indirect call which has a USE for the register. As a result,
the pic offset table register is not valid after the first call in the
loop and a seg fault occurs.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-27 19:41 John David Anglin @ 2002-01-27 22:45 ` H . J . Lu 2002-01-28 7:27 ` Geoff Keating 1 sibling, 0 replies; 20+ messages in thread From: H . J . Lu @ 2002-01-27 22:45 UTC (permalink / raw) To: John David Anglin; +Cc: gcc-patches On Sun, Jan 27, 2002 at 09:39:30PM -0500, John David Anglin wrote: > > The last good one for me is Jan 24 16:56 PST 2002. I am tracking down > > which patch breaks Linux/mipsel now. Irix6.5/mips seems ok. It may be > > another ABI/ednian bug. > > I am seeing increased testsuite failures on hppa2.0w-hp-hpux11.11 as of > Jan. 26 09:10:13 UTC. My last good build was as of Jan. 25 05:05:05 UTC. It may be a different bug. "Jan 26 14:00:00 UTC 2002" seems ok on Linux/mipsel. > I have looked at one of the new failure (g++.abi/cxa_vec.C). The failure > appears to be a new bug in the loop pass. After every call on the PA, > the pic offset table register needs to be restored. For some reason, > the loop pass pulled the insn doing this restore out of the loop, apparently > ignoring an indirect call which has a USE for the register. As a result, > the pic offset table register is not valid after the first call in the > loop and a seg fault occurs. > H.J. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-27 19:41 John David Anglin 2002-01-27 22:45 ` H . J . Lu @ 2002-01-28 7:27 ` Geoff Keating 2002-01-28 9:04 ` John David Anglin 1 sibling, 1 reply; 20+ messages in thread From: Geoff Keating @ 2002-01-28 7:27 UTC (permalink / raw) To: John David Anglin; +Cc: gcc-patches "John David Anglin" <dave@hiauly1.hia.nrc.ca> writes: > After every call on the PA, the pic offset table register needs to > be restored. For some reason, the loop pass pulled the insn doing > this restore out of the loop, apparently ignoring an indirect call > which has a USE for the register. As a result, You mean CLOBBER, right? If it's just a USE, of course the restore can be hoisted. -- - Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com> ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-28 7:27 ` Geoff Keating @ 2002-01-28 9:04 ` John David Anglin 0 siblings, 0 replies; 20+ messages in thread From: John David Anglin @ 2002-01-28 9:04 UTC (permalink / raw) To: Geoff Keating; +Cc: gcc-patches > > After every call on the PA, the pic offset table register needs to > > be restored. For some reason, the loop pass pulled the insn doing > > this restore out of the loop, apparently ignoring an indirect call > > which has a USE for the register. As a result, > > You mean CLOBBER, right? If it's just a USE, of course the restore > can be hoisted. The reason that the restore shouldn't be hoisted is PIC_OFFSET_TABLE_REG_CALL_CLOBBERED is defined. This only applies when pic code is being generated. This register is also one of the CALL_USED_REGISTERS, and one of the FIXED_REGISTERS when pic code is being generated. I have identified the patch that introduced the problem: <http://gcc.gnu.org/ml/gcc-patches/2002-01/msg01836.html>. > While working on a loop optimization issue I noticed that gen_rtx_REG > does not return the same rtx pointer when called with > PIC_OFFSET_TABLE_REGNUM like it does if called with > RETURN_ADDRESS_POINTER_REGNUM or STACK_POINTER_REGNUM. This comes up in > loop.c (loop_regs_scan) where we loop: > > for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) > if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i) > && rtx_varies_p (gen_rtx_REG (Pmode, i), /*for_alias=*/1)) rtx_varies_p is called with for_alias=1, so the pic_offset_table_rtx is going to be treated as a constant even though PIC_OFFSET_TABLE_REG_CALL_CLOBBERED is set. This apparently enables the restore to be hoisted. Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605) ^ permalink raw reply [flat|nested] 20+ messages in thread
[parent not found: <no.id>]
* Re: gcc failed to bootstrap on Linux/mipsel [not found] <no.id> @ 2002-01-28 9:28 ` John David Anglin 2002-01-28 11:10 ` Richard Henderson 0 siblings, 1 reply; 20+ messages in thread From: John David Anglin @ 2002-01-28 9:28 UTC (permalink / raw) To: John David Anglin; +Cc: geoffk, gcc-patches > > for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) > > if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i) > > && rtx_varies_p (gen_rtx_REG (Pmode, i), /*for_alias=*/1)) I see the problem. The comment for the above is incorrect: /* Invalidate all hard registers clobbered by calls. With one exception: a call-clobbered PIC register is still function-invariant for our purposes, since we can hoist any PIC calculations out of the loop. Thus the call to rtx_varies_p. */ You can hoist any insns involving the PIC register except those that set it. Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605) ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-28 9:28 ` John David Anglin @ 2002-01-28 11:10 ` Richard Henderson 2002-01-28 11:18 ` John David Anglin 0 siblings, 1 reply; 20+ messages in thread From: Richard Henderson @ 2002-01-28 11:10 UTC (permalink / raw) To: John David Anglin; +Cc: geoffk, gcc-patches On Mon, Jan 28, 2002 at 12:04:49PM -0500, John David Anglin wrote: > > > for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) > > > if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i) > > > && rtx_varies_p (gen_rtx_REG (Pmode, i), /*for_alias=*/1)) > > I see the problem. The comment for the above is incorrect: > > /* Invalidate all hard registers clobbered by calls. With one exception: > a call-clobbered PIC register is still function-invariant for our > purposes, since we can hoist any PIC calculations out of the loop. > Thus the call to rtx_varies_p. */ > > You can hoist any insns involving the PIC register except those > that set it. Bugger all. Well, I guess we'll just have to do for_alias=0 for now. I don't think we can fix this properly for 3.1. r~ ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-28 11:10 ` Richard Henderson @ 2002-01-28 11:18 ` John David Anglin 2002-01-28 11:19 ` Richard Henderson 0 siblings, 1 reply; 20+ messages in thread From: John David Anglin @ 2002-01-28 11:18 UTC (permalink / raw) To: Richard Henderson; +Cc: geoffk, gcc-patches > > You can hoist any insns involving the PIC register except those > > that set it. > > Bugger all. Well, I guess we'll just have to do for_alias=0 > for now. I don't think we can fix this properly for 3.1. Is this obviously wrong? I'm trying it now. Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605) 2002-01-28 John David Anglin <dave@hiauly1.hia.nrc.ca> * loop.c (scan_loop): Don't hoist insns that set the pic offset table register if PIC_OFFSET_TABLE_REG_CALL_CLOBBERED is defined and we are generating PIC code. --- loop.c.orig Fri Jan 25 00:04:25 2002 +++ loop.c Mon Jan 28 13:49:58 2002 @@ -762,6 +762,9 @@ if (GET_CODE (p) == INSN && (set = single_set (p)) && GET_CODE (SET_DEST (set)) == REG +#ifdef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED + && (! flag_pic || SET_DEST (set) != pic_offset_table_rtx) +#endif && ! regs->array[REGNO (SET_DEST (set))].may_not_optimize) { int tem1 = 0; ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-28 11:18 ` John David Anglin @ 2002-01-28 11:19 ` Richard Henderson 2002-01-28 11:39 ` John David Anglin 0 siblings, 1 reply; 20+ messages in thread From: Richard Henderson @ 2002-01-28 11:19 UTC (permalink / raw) To: John David Anglin; +Cc: geoffk, gcc-patches On Mon, Jan 28, 2002 at 02:12:40PM -0500, John David Anglin wrote: > +#ifdef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED > + && (! flag_pic || SET_DEST (set) != pic_offset_table_rtx) > +#endif Well flag_pic definitely shouldn't be here. ia64 for instance uses pic_offset_table_rtx all the time. r~ ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-28 11:19 ` Richard Henderson @ 2002-01-28 11:39 ` John David Anglin 2002-01-28 12:07 ` Richard Henderson 0 siblings, 1 reply; 20+ messages in thread From: John David Anglin @ 2002-01-28 11:39 UTC (permalink / raw) To: Richard Henderson; +Cc: geoffk, gcc-patches > On Mon, Jan 28, 2002 at 02:12:40PM -0500, John David Anglin wrote: > > +#ifdef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED > > + && (! flag_pic || SET_DEST (set) != pic_offset_table_rtx) > > +#endif > > Well flag_pic definitely shouldn't be here. ia64 for instance > uses pic_offset_table_rtx all the time. What about testing to see if the PIC_OFFSET_TABLE_REGNUM isn't a fixed register? Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605) ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-28 11:39 ` John David Anglin @ 2002-01-28 12:07 ` Richard Henderson 2002-01-28 16:04 ` John David Anglin 0 siblings, 1 reply; 20+ messages in thread From: Richard Henderson @ 2002-01-28 12:07 UTC (permalink / raw) To: John David Anglin; +Cc: geoffk, gcc-patches On Mon, Jan 28, 2002 at 02:31:51PM -0500, John David Anglin wrote: > What about testing to see if the PIC_OFFSET_TABLE_REGNUM isn't a fixed > register? I guess that would be ok. Actualy, should change gen_reg_RTX to check that and have loop test vs pic_offset_table_rtx. r~ ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-28 12:07 ` Richard Henderson @ 2002-01-28 16:04 ` John David Anglin 2002-01-28 17:00 ` Richard Henderson 0 siblings, 1 reply; 20+ messages in thread From: John David Anglin @ 2002-01-28 16:04 UTC (permalink / raw) To: Richard Henderson; +Cc: geoffk, gcc-patches > > What about testing to see if the PIC_OFFSET_TABLE_REGNUM isn't a fixed > > register? > > I guess that would be ok. Actualy, should change gen_reg_RTX > to check that and have loop test vs pic_offset_table_rtx. This fixes cxa_vec.C and several hundred objc failures. Tested on hppa2.0w-hp-hpux11.11. OK? Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605) 2002-01-28 John David Anglin <dave@hiauly1.hia.nrc.ca> * emit-rtl.c (gen_rtx_REG): Check that the PIC_OFFSET_TABLE_REGNUM is a fixed register before returning pic_offset_table_rtx. * loop.c (scan_loop): Don't hoist insns that set pic_offset_table_rtx when PIC_OFFSET_TABLE_REG_CALL_CLOBBERED is defined. --- emit-rtl.c.orig Mon Jan 28 12:11:37 2002 +++ emit-rtl.c Mon Jan 28 15:06:47 2002 @@ -411,7 +411,8 @@ if (regno == RETURN_ADDRESS_POINTER_REGNUM) return return_address_pointer_rtx; #endif - if (regno == PIC_OFFSET_TABLE_REGNUM) + if (regno == PIC_OFFSET_TABLE_REGNUM + && fixed_regs[PIC_OFFSET_TABLE_REGNUM]) return pic_offset_table_rtx; if (regno == STACK_POINTER_REGNUM) return stack_pointer_rtx; --- loop.c.orig Fri Jan 25 00:04:25 2002 +++ loop.c Mon Jan 28 15:00:03 2002 @@ -762,6 +762,9 @@ if (GET_CODE (p) == INSN && (set = single_set (p)) && GET_CODE (SET_DEST (set)) == REG +#ifdef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED + && SET_DEST (set) != pic_offset_table_rtx +#endif && ! regs->array[REGNO (SET_DEST (set))].may_not_optimize) { int tem1 = 0; ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: gcc failed to bootstrap on Linux/mipsel 2002-01-28 16:04 ` John David Anglin @ 2002-01-28 17:00 ` Richard Henderson 0 siblings, 0 replies; 20+ messages in thread From: Richard Henderson @ 2002-01-28 17:00 UTC (permalink / raw) To: John David Anglin; +Cc: geoffk, gcc-patches On Mon, Jan 28, 2002 at 06:56:56PM -0500, John David Anglin wrote: > * emit-rtl.c (gen_rtx_REG): Check that the PIC_OFFSET_TABLE_REGNUM > is a fixed register before returning pic_offset_table_rtx. > * loop.c (scan_loop): Don't hoist insns that set pic_offset_table_rtx > when PIC_OFFSET_TABLE_REG_CALL_CLOBBERED is defined. Ok. r~ ^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2002-01-30 18:08 UTC | newest] Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2002-01-27 17:36 gcc failed to bootstrap on Linux/mipsel H . J . Lu 2002-01-28 12:47 ` H . J . Lu 2002-01-28 13:01 ` Richard Henderson 2002-01-29 23:37 ` H . J . Lu 2002-01-30 0:36 ` H . J . Lu 2002-01-30 0:40 ` Richard Henderson 2002-01-30 9:29 ` H . J . Lu 2002-01-30 10:09 ` Richard Henderson 2002-01-27 19:41 John David Anglin 2002-01-27 22:45 ` H . J . Lu 2002-01-28 7:27 ` Geoff Keating 2002-01-28 9:04 ` John David Anglin [not found] <no.id> 2002-01-28 9:28 ` John David Anglin 2002-01-28 11:10 ` Richard Henderson 2002-01-28 11:18 ` John David Anglin 2002-01-28 11:19 ` Richard Henderson 2002-01-28 11:39 ` John David Anglin 2002-01-28 12:07 ` Richard Henderson 2002-01-28 16:04 ` John David Anglin 2002-01-28 17:00 ` Richard Henderson
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).