Test case: unsigned char foo(unsigned char ch) { if( (0x01 & ch) > 0) return 1; } Above test code gives internal compiler error if compiled with option -O2 in 3.3 branch for h8300 coff tool chain(all targhets). This error is not observed in 3.4 branch. If we remove, " > 0" from test code, program gets compiled with -O2 option and also if we use any nonzero number instead of 0 then also it gets compiled successfully with -O2 option.
I can confirm this in 3.3.1 (20030728). From final.c: 2795 #ifdef HAVE_ATTR_length 2796 /* This instruction should have been split in shorten_branches, 2797 to ensure that we would have valid length info for the 2798 splitees. */ 2799 abort (); 2800 #endif
I also can confirm this does not ICE on the mainline (20030718).
3.2.3 did not have the problem so this is a regression.
Subject: Bug 11805 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: kazu@gcc.gnu.org 2003-08-21 13:08:53 Modified files: gcc : ChangeLog gcc/config/h8300: h8300.md gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.c-torture/compile: 20030821-1.c Log message: PR target/11805 * config/h8300/h8300.md (two anonymous patterns): Remove. * testsuite/gcc.c-torture/compile/20030821-1.c: New. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.710&r2=1.16114.2.711 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/h8300/h8300.md.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.123.2.5&r2=1.123.2.6 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.251&r2=1.2261.2.252 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/20030821-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
Just committed a fix.
Subject: Bug 11805 CVSROOT: /cvs/gcc Module name: gcc Changes by: kazu@gcc.gnu.org 2003-08-21 13:13:18 Modified files: gcc : ChangeLog gcc/config/h8300: h8300.md gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.c-torture/compile: 20030821-1.c Log message: PR target/11805 * config/h8300/h8300.md (two anonymous patterns): Remove. * testsuite/gcc.c-torture/compile/20030821-1.c: New. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.830&r2=2.831 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/h8300/h8300.md.diff?cvsroot=gcc&r1=1.233&r2=1.234 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2986&r2=1.2987 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/20030821-1.c.diff?cvsroot=gcc&r1=1.1&r2=1.2
*** Bug 12124 has been marked as a duplicate of this bug. ***