------- Comment #3 from dave at hiauly1 dot hia dot nrc dot ca 2008-01-13 01:46 ------- Subject: Re: [4.2 regression] internal compiler error: in delete_output_reload, at reload1.c:7958
> Probably a dup of PR32889. Agreed but the current 4.2 branch still ICEs. The failure doesn't occur with 4.3. I'm having difficulty understanding why this was classified as target bug. It appears to me to be a middle-end (reload) bug. Before the ICE, we handle a very similar reload: Starting program: /home/dave/gcc-4.2/objdir/stage1-gcc/cc1 -fpreprocessed pr34762.i -dumpbase pr34762.i -auxbase pr34762 -O2 -version -o pr34762.s -fPIC GNU C version 4.2.3 20080106 (prerelease) (hppa-linux) compiled by GNU C version 4.1.0. GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 options passed: -fpreprocessed -auxbase -O2 -fPIC options enabled: -fPIC -falign-loops -fargument-alias -fbranch-count-reg -fcaller-saves -fcommon -fcprop-registers -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdefer-pop -fdelayed-branch -fdelete-null-pointer-checks -fearly-inlining -feliminate-unused-debug-types -fexpensive-optimizations -ffunction-cse -fgcse -fgcse-lm -fguess-branch-probability -fident -fif-conversion -fif-conversion2 -finline-functions-called-once -fipa-pure-const -fipa-reference -fipa-type-escape -fivopts -fkeep-static-consts -fleading-underscore -fmath-errno -fmerge-constants -fmove-loop-invariants -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls -fpeephole -fpeephole2 -freg-struct-return -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop -fsched-interblock -fsched-spec -fsched-stalled-insns-dep -fschedule-insns -fschedule-insns2 -fshow-column -fsplit-ivs-in-unroller -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftoplevel-reorder -ftrapping-math -ftree-ccp -ftree-ch -ftree-copy-prop -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -ftree-lrs -ftree-pre -ftree-salias -ftree-sink -ftree-sra -ftree-store-ccp -ftree-store-copy-prop -ftree-ter -ftree-vect-loop-version -ftree-vrp -funit-at-a-time -fvar-tracking -fzero-initialized-in-bss -mbig-switch -mgas -mglibc -mno-space-regs Compiler executable checksum: 7052689d04078c8c580b43f74ef2f4ae gnu_dev_major gnu_dev_minor gnu_dev_makedev stat lstat fstat fstatat mknod mknodat stat64 lstat64 fstat64 fstatat64 vprintf getchar fgetc_unlocked getc_unlocked getchar_unlocked putchar fputc_unlocked putc_unlocked putchar_unlocked getline feof_unlocked ferror_unlocked __strcspn_c1 __strcspn_c2 __strcspn_c3 __strspn_c1 __strspn_c2 __strspn_c3 __strpbrk_c2 __strpbrk_c3 __strtok_r_1c __strsep_1c __strsep_2c __strsep_3c strtod strtol strtoul strtof strtold strtoq strtouq strtoll strtoull atof atoi atol atoll tolower toupper __sigismember __sigaddset __sigdelset __cmsg_nxthdr xislower xisupper xisalpha xisdigit xisalnum xisblank xisspace xtolower xtoupper headerFreeData h2hv headerNew headerFree headerLink headerUnlink headerSort headerUnsort headerSizeof headerUnload headerReload headerCopy headerLoad headerCopyLoad headerRead headerWrite headerIsEntry headerFreeTag headerGetEntry headerGetEntryMinMemory headerAddEntry headerAppendEntry headerAddOrAppendEntry headerAddI18NStrin! g headerModifyEntry headerRemoveEntry headerSprintf headerCopyTags headerFreeIterator headerInitIterator headerNextIterator _free tag2sln runLuaScript runScript runInstScript start Analyzing compilation unitPerforming interprocedural optimizations Assembling functions: tag2sln headerFreeData runInstScript Breakpoint 1, emit_move_sequence (operands=0xfb6c74cc, mode=SImode, scratch_reg=0x0) at ../../gcc/gcc/config/pa/pa.c:1332 1332 register rtx operand0 = operands[0]; (gdb) p debug_rtx (operands[0]) (reg:SI 21 %r21) $18 = void (gdb) p debug_rtx (operands[1]) (const_int 8252 [0x203c]) $19 = void (gdb) bt #0 emit_move_sequence (operands=0xfb6c74cc, mode=SImode, scratch_reg=0x0) at ../../gcc/gcc/config/pa/pa.c:1332 #1 0x0052d0e4 in gen_movsi (operand0=0x403bed70, operand1=0x403b67a0) at ../../gcc/gcc/config/pa/pa.md:2430 #2 0x003f1354 in emit_move_insn_1 (x=0x403bed70, y=0x403b67a0) at ../../gcc/gcc/expr.c:3225 #3 0x0057a2d4 in gen_move_insn (x=0x403bed70, y=0x403b67a0) at ../../gcc/gcc/optabs.c:4399 #4 0x006096d8 in gen_reload (out=0x403bed70, in=0x403b67a0, opnum=0, type=RELOAD_FOR_OUTPUT_ADDRESS) at ../../gcc/gcc/reload1.c:7839 #5 0x0060934c in gen_reload (out=0x403bed70, in=0x403bed40, opnum=0, type=RELOAD_FOR_OUTPUT_ADDRESS) at ../../gcc/gcc/reload1.c:7746 #6 0x006055ac in emit_input_reload_insns (chain=0xadfdf8, rl=0xa3b00c, old=0x403bed40, j=0) at ../../gcc/gcc/reload1.c:6798 #7 0x006064d8 in do_input_reload (chain=0xadfdf8, rl=0xa3b00c, j=0) at ../../gcc/gcc/reload1.c:7055 #8 0x00606fdc in emit_reload_insns (chain=0xadfdf8) at ../../gcc/gcc/reload1.c:7228 ... (gdb) c Continuing Breakpoint 2, delete_output_reload (insn=0x403a6f28, j=1, last_reload_reg=5) at ../../gcc/gcc/reload1.c:7932 7932 gcc_assert (!rtx_equal_p (XEXP (i1, 0), substed)); (gdb) p debug_rtx (insn) (insn 314 313 315 25 (set (mem/c:SI (plus:SI (reg/f:SI 3 %r3) (const_int 8256 [0x2040])) [89 freePrefixes+0 S4 A32]) (const_int 0 [0x0])) 37 {*pa.md:2484} (nil) (nil)) $22 = void (gdb) p debug_rtx (substed) (mem/c:SI (plus:SI (reg/f:SI 3 %r3) (const_int 8256 [0x2040])) [89 freePrefixes+0 S4 A32]) $23 = void (gdb) p debug_rtx (i1) (expr_list:REG_EQUIV (mem/c:SI (plus:SI (reg/f:SI 3 %r3) (const_int 8256 [0x2040])) [89 freePrefixes+0 S4 A32]) (nil)) $24 = void The backend doesn't generate REG_EQUIV notes. >From pr34762.i.138r.greg, the first reload is Reloads for insn # 307 Reload 0: reload_in (SI) = (plus:SI (reg/f:SI 3 %r3) (const_int 8256 [0x2040])) GENERAL_REGS, RELOAD_FOR_OPERAND_ADDRESS (opnum = 0), can't combine reload_in_reg: (plus:SI (reg/f:SI 3 %r3) (const_int 8256 [0x2040])) reload_reg_rtx: (reg:SI 20 %r20) Reload 1: reload_out (SI) = (mem/c:SI (plus:SI (reg/f:SI 3 %r3) (const_int 8256 [0x2040] )) [89 freePrefixes+0 S4 A32]) NO_REGS, RELOAD_FOR_OUTPUT (opnum = 0), optional reload_out_reg: (reg/v:SI 208 [ freePrefixes ]) Then, we fail with with this one Reloads for insn # 314 Reload 0: reload_in (SI) = (plus:SI (reg/f:SI 3 %r3) (const_int 8256 [0x2040])) GENERAL_REGS, RELOAD_FOR_OPERAND_ADDRESS (opnum = 0), can't combine reload_in_reg: (plus:SI (reg/f:SI 3 %r3) (const_int 8256 [0x2040])) reload_reg_rtx: (reg:SI 21 %r21) Reload 1: reload_out (SI) = (mem/c:SI (plus:SI (reg/f:SI 3 %r3) (const_int 8256 [0x2040] )) [89 freePrefixes+0 S4 A32]) NO_REGS, RELOAD_FOR_OUTPUT (opnum = 0), optional reload_out_reg: (reg/v:SI 208 [ freePrefixes ]) Dave -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34762