I found a bug of ICE in gcc-4.4.3 on sh-elf. gcc-4.3 and gcc-4.5 does not have this problem. $ gcc -O2 mtest01-k-e.c mtest01-k.c: In function �emain�f: mtest01-k.c:88: error: could not split insn (jump_insn 312 302 472 mtest01-k.c:64 (parallel [ (set (pc) (if_then_else (leu (reg/v:DI 12 r12 [orig:310 maxbytes ] [310]) (const_int 1073741824 [0x40000000])) (label_ref:SI 516) (pc))) (clobber (reg:SI 10 r10)) (clobber (reg:SI 147 t)) ]) 6 {cbranchdi4_i} (expr_list:REG_BR_PRED (const_int 49 [0x31]) (expr_list:REG_UNUSED (reg:SI 147 t) (expr_list:REG_UNUSED (reg:SI 10 r10) (expr_list:REG_BR_PROB (const_int 0 [0x0]) (nil)))))) mtest01-k.c:88: internal compiler error: in final_scan_insn, at final.c:2604 Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions. When I don't optimize it, it doesn't become the error. $ gcc-4.4 -v Using built-in specs. Target: sh4-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.3-3' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --with-multilib-list=m4,m4-nofpu --with-cpu=sh4 --enable-checking=release --build=sh4-linux-gnu --host=sh4-linux-gnu --target=sh4-linux-gnu Thread model: posix gcc version 4.4.3 (Debian 4.4.3-3)
Created attachment 20138 [details] The source code that can reproduce a problem. this code generate by -E option. Sorry. There is the code to reappear, but cannot lower it.
Looks the same issue in http://gcc.gnu.org/ml/gcc-patches/2009-04/msg00747.html though I can't reproduce the problem with my gcc-4.4.3 and 4.4 head compilers for the test case in #1. Could you try the patch in the above URL?
(In reply to comment #2) > Looks the same issue in > > http://gcc.gnu.org/ml/gcc-patches/2009-04/msg00747.html > > though I can't reproduce the problem with my gcc-4.4.3 and > 4.4 head compilers for the test case in #1. > Could you try the patch in the above URL? I tested this patch. The problem was revised. gcc-4.4.3 of debian(20,100,226 SVN / r157081 base) revision was not taken in. Thank you.
I'm able to reproduce it with -O2 -fno-schedule-insns on 4.4. Perhaps debian uses the local patch to make -fno-schedule-insns default. I'll backport the patch referred in #2 to 4.4 branch if it passes the usual tests on that branch.
Subject: Bug 43417 Author: kkojima Date: Sun Mar 21 22:29:19 2010 New Revision: 157610 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157610 Log: Backport from mainline: 2009-05-12 Paolo Bonzini <bonzini@gnu.org> PR target/43417 * config/sh/sh.md (cbranchdi4_i): Use an "I08" constraint instead of "i" constraint. Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/config/sh/sh.md
Fixed.
For the record, -m4 is needed to reproduce this issue.
Subject: Bug 43417 Author: jiez Date: Sat Apr 10 15:12:14 2010 New Revision: 158192 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158192 Log: PR target/43417 * gcc.target/sh/pr43417.c: New test. Added: trunk/gcc/testsuite/gcc.target/sh/pr43417.c Modified: trunk/gcc/testsuite/ChangeLog
Subject: Bug 43417 Author: jiez Date: Sat Apr 10 15:14:13 2010 New Revision: 158193 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158193 Log: PR target/43417 * gcc.target/sh/pr43417.c: New test. Added: branches/gcc-4_4-branch/gcc/testsuite/gcc.target/sh/pr43417.c Modified: branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
Subject: Bug 43417 Author: jiez Date: Sat Apr 10 15:17:15 2010 New Revision: 158194 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158194 Log: PR target/43417 * gcc.target/sh/pr43417.c: New test. Added: branches/gcc-4_5-branch/gcc/testsuite/gcc.target/sh/pr43417.c Modified: branches/gcc-4_5-branch/gcc/testsuite/ChangeLog