Here's how I configure gcc: /n/08/rask/src/gcc/configure --target=m32c-unknown-elf --disable-libgfortran --disable-multilib --disable-nls --with-newlib --enable-sim --disable-gdb The error message: /home/rask/build/gcc-m32c-unknown-elf/./gcc/xgcc -B/home/rask/build/gcc-m32c-unknown-elf/./gcc/ -nostdinc -B/home/rask/build/gcc-m32c-unknown-elf/m32c-unknown-elf/newlib/ -isystem /home/rask/build/gcc-m32c-unknown-elf/m32c-unknown-elf/newlib/targ-include -isystem /n/08/rask/src/gcc/newlib/libc/include -B/home/rask/build/gcc-m32c-unknown-elf/m32c-unknown-elf/libgloss/m32c -L/home/rask/build/gcc-m32c-unknown-elf/m32c-unknown-elf/libgloss/libnosys -L/n/08/rask/src/gcc/libgloss/m32c -B/usr/local/m32c-unknown-elf/bin/ -B/usr/local/m32c-unknown-elf/lib/ -isystem /usr/local/m32c-unknown-elf/include -isystem /usr/local/m32c-unknown-elf/sys-include -L/home/rask/build/gcc-m32c-unknown-elf/./ld -O2 -g -O2 -O2 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../.././gcc -I/n/08/rask/src/gcc/libgcc -I/n/08/rask/src/gcc/libgcc/. -I/n/08/rask/src/gcc/libgcc/../gcc -I/n/08/rask/src/gcc/libgcc/../include -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c /n/08/rask/src/gcc/libgcc/../gcc/libgcc2.c \ /n/08/rask/src/gcc/libgcc/../gcc/libgcc2.c: In function '__muldi3': /n/08/rask/src/gcc/libgcc/../gcc/libgcc2.c:566: internal compiler error: in cselib_record_set, at cselib.c:1508 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. make[2]: *** [_muldi3.o] Error 1 make[2]: Leaving directory `/home/rask/build/gcc-m32c-unknown-elf/m32c-unknown-elf/libgcc' make[1]: *** [all-target-libgcc] Error 2 make[1]: Leaving directory `/home/rask/build/gcc-m32c-unknown-elf' make: *** [all] Error 2
The avr target has the same problem: /n/07/mstein/svn/trunk/libgcc/../gcc/libgcc2.c: In function '__muldi3': /n/07/mstein/svn/trunk/libgcc/../gcc/libgcc2.c:566: internal compiler error: in cselib_record_set, at cselib.c:1508
please include the preprocessed source (the .i file) and the command line to compiler this.
Created attachment 13715 [details] gcc/xgcc -O2 libgcc2.i should trigger the bug
Subject: Re: libgcc build failure, ICE in cselib_record_set, at cselib.c:1508 zadeck at naturalbridge dot com wrote: the new dse code is failing during a call to cselib. However I do not believe that the new dse is to blame. Here is the issue. Dse is failing at #0 fancy_abort (file=0xc3cf76 "../../gcc32335/gcc/cselib.c", line=1508, function=0xc3d9f0 "cselib_record_set") at ../../gcc32335/gcc/diagnostic.c:656 #1 0x000000000056e59e in cselib_record_set (dest=0x2b5212d6a4e0, src_elt=0x1075ca0, dest_addr_elt=0x0) at ../../gcc32335/gcc/cselib.c:1508 which is the only assert in cselib_record_set. The insn that it is chocking on is a parallel (jump_insn 268 267 269 6 /n/07/mstein/svn/trunk/libgcc/../gcc/libgcc2.c:566 (parallel [ (set (reg:PSI 8 sp) (reg:PSI 7 fb)) (set (reg:PSI 7 fb) (mem:PSI (reg:PSI 8 sp) [0 S4 A8])) (set (reg:PSI 8 sp) (plus:PSI (reg:PSI 8 sp) (const_int 2 [0x2]))) (return) ]) -1 (nil)) $2 = void i assume that the thing that cselib does not like is the fact that sp is being set twice in the same insn. I guess on thinking about it, I really do not like this insn either. I checked to make sure that this was not auto-inc code on drugs. the same failure happens with -fno-auto-inc-dec. I think that dse is hitting this bug, not because the dataflow merge is doing something stupid but because this port is (and most likely has been for a long time) doing something stupid and the new dse code is asking cselib to go where no cselib has gone before. Comments?
I agree that the insn is invalid. It probably should be something like this: (parallel [ (set (reg:PSI 7 fb) (mem:PSI (reg:PSI 7 fb) [0 S4 A8])) (set (reg:PSI 8 sp) (plus:PSI (reg:PSI 7 fb) (const_int 2 [0x2]))) (return) ]) I.e. one set of sp and fb each. The faulty pattern is named "epilogue_exitd". The two patterns "prologue_enter_16" and "prologue_enter_24" are also broken in that they use (parallel [ ... (pre_dec (SP_REGNO)) (set (SP_REGNO) ...) ]) which is just another invalid use of PARALLEL. DJ? On the AVR, my bets are on the define_insn "call_prologue_saves" with two sets of (reg:HI SP_REG) inside the implicit parallel.
Subject: Re: libgcc build failure, ICE in cselib_record_set, at cselib.c:1508 rask at sygehus dot dk wrote: > ------- Comment #5 from rask at sygehus dot dk 2007-06-17 08:43 ------- > I agree that the insn is invalid. It probably should be something like this: > > (parallel [ > (set (reg:PSI 7 fb) > (mem:PSI (reg:PSI 7 fb) [0 S4 A8])) > (set (reg:PSI 8 sp) > (plus:PSI (reg:PSI 7 fb) > (const_int 2 [0x2]))) > (return) > ]) > > I.e. one set of sp and fb each. The faulty pattern is named "epilogue_exitd". > The two patterns "prologue_enter_16" and "prologue_enter_24" are also broken in > that they use > (parallel [ > ... (pre_dec (SP_REGNO)) > (set (SP_REGNO) ...) > ]) > which is just another invalid use of PARALLEL. DJ? > > On the AVR, my bets are on the define_insn "call_prologue_saves" with two sets > of (reg:HI SP_REG) inside the implicit parallel. > > > i assume that you will resolve this with the port maintainers and contact me when you hit the next dataflow related problem. Good luck. Kenny
Subject: Bug number PR target/32335 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-06/msg01233.html
Im working on patch for avr target. Anatoly.
Subject: Bug 32335 Author: rask Date: Tue Jun 19 17:35:16 2007 New Revision: 125853 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125853 Log: 2007-06-19 Rask Ingemann Lambertsen <rask@sygehus.dk> PR target/32335 * config/m32c/m32c.c: Include dataflow header file. (m32c_emit_prologue): Adjust for prologue insn change. * config/m32c/prologue.md (prologue_enter_16): Only modify SP_REGNO once inside a PARALLEL. Assume frame size passed in operand 0 includes space to save the fb register. (prologue_enter_24): Likewise. (epilogue_exitd): Only modify SP_REGNO once inside a PARALLEL. Modified: trunk/gcc/ChangeLog trunk/gcc/config/m32c/m32c.c trunk/gcc/config/m32c/prologue.md
I'm adding the m32c back because the testcase for bug 32069 fails with optimization turned on: $ ./xgcc -B./ /n/08/rask/src/gcc/gcc/testsuite/gcc.dg/pr32069.c -S -dp -o /dev/null -O1 /n/08/rask/src/gcc/gcc/testsuite/gcc.dg/pr32069.c: In function 'segfault': /n/08/rask/src/gcc/gcc/testsuite/gcc.dg/pr32069.c:7: internal compiler error: in cselib_record_set, at cselib.c:1508 (gdb) call debug_rtx(insn) (jump_insn 62 61 63 2 /n/08/rask/src/gcc/gcc/testsuite/gcc.dg/pr32069.c:7 (parallel [ (set (reg:PSI 8 sp) (plus:PSI (reg:PSI 7 fb) (const_int 2 [0x2]))) (set (reg:PSI 7 fb) (mem:PSI (reg:PSI 7 fb) [0 S4 A8])) (return) ]) -1 (nil))
Ah, notice the mismatch in register sizes between prologue and epilogue: (insn/f 59 5 60 2 /n/08/rask/src/gcc/gcc/testsuite/gcc.dg/pr32069.c:5 (parallel [ (set/f (mem:HI (plus:HI (reg/f:HI 8 sp) (const_int -2 [0xfffffffe])) [0 S2 A8]) (reg/f:HI 7 fb)) (set/f (reg/f:HI 7 fb) (reg/f:HI 8 sp)) (set/f (reg/f:HI 8 sp) (minus:HI (reg/f:HI 8 sp) (const_int 2 [0x2]))) ]) -1 (nil))
Subject: Bug number PR target/32335 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-06/msg01501.html
Subject: Bug 32335 Author: rask Date: Wed Jun 20 19:57:32 2007 New Revision: 125892 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125892 Log: 2007-06-20 Rask Ingemann Lambertsen <rask@sygehus.dk> PR target/32335 * config/m32c/m32c.c (m32c_emit_epilogue): Use new HImode epilogue for TARGET_A16. * config/m32c/prologue.md (epilogue_exitd_16): New. (epilogue_reit_16): New. (epilogue_exitd): Rename to epilogue_exitd_24. (epilogue_reit): Rename to epilogue_reit_24. Modified: trunk/gcc/config/m32c/m32c.c trunk/gcc/config/m32c/prologue.md
Subject: Bug 32335 Author: rask Date: Wed Jun 20 19:58:57 2007 New Revision: 125893 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125893 Log: 2007-06-20 Rask Ingemann Lambertsen <rask@sygehus.dk> PR target/32335 * config/m32c/m32c.c (m32c_emit_epilogue): Use new HImode epilogue for TARGET_A16. * config/m32c/prologue.md (epilogue_exitd_16): New. (epilogue_reit_16): New. (epilogue_exitd): Rename to epilogue_exitd_24. (epilogue_reit): Rename to epilogue_reit_24. Modified: trunk/gcc/ChangeLog
Subject: Bug 32335 Author: aesok Date: Fri Jun 29 20:05:56 2007 New Revision: 126121 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126121 Log: PR target/32335 * config/avr/avr.c: Include dataflow header file. (expand_prologue): Adjust for prologue insn change. * config/avr/avr.md (call_prologue_saves): Only modify REG_SP once inside a insn. Modified: trunk/gcc/ChangeLog trunk/gcc/config/avr/avr.c trunk/gcc/config/avr/avr.md
Fixed for avr target.
Fixed for both m32c and avr, so closing.