The following, compiled with -O1 results in ICE on i386-pc-mingw32, with GCC-3.4.0. -O0 and -O2 work fine. On trunk, the code compiles at all optimisation levels /* test1.c */ typedef struct _foo { unsigned long _bkgd; } FOO; void wbkgdset (FOO* foo, unsigned long ch) { unsigned long bkgdattr; if ( (ch & 0xFFFF0000UL) == 0UL ) bkgdattr = 0x0000000UL; else bkgdattr = (ch & 0xFFFF0000UL); foo->_bkgd = (ch | bkgdattr); } >gcc-3.4.0 -O1 -c test1.c test1.c: In function `wbkgdset': test1.c:17: error: unrecognizable insn: (insn 36 11 23 0 (set (reg/v:SI 60 [ bkgdattr ]) (and:SI (reg/v:SI 59 [ ch ]) (const_int -65536 [0xffff0000]))) -1 (nil) (nil)) test1.c:17: internal compiler error: in extract_insn, at recog.c:2083 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://www.mingw.org/bugs.shtml> for instructions. If I simplify the if...else to: bkgdattr = (ch & 0xFFFF0000UL); there is no problem. Danny
Confirmed.
Richard, this is another IA32 backend issue.
Testing a patch.
How did the patch turn out?
Subject: Bug 15550 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: rth@gcc.gnu.org 2004-06-19 19:08:46 Modified files: gcc : ChangeLog ifcvt.c Log message: PR target/15550 * ifcvt.c (noce_try_move): Recognize all generated instructions. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.513&r2=2.2326.2.514 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ifcvt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.136&r2=1.136.4.1
Subject: Bug 15550 CVSROOT: /cvs/gcc Module name: gcc Changes by: rth@gcc.gnu.org 2004-06-19 19:13:04 Modified files: gcc : ChangeLog ifcvt.c Log message: PR target/15550 * ifcvt.c (noce_try_move): Recognize all generated instructions. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4043&r2=2.4044 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ifcvt.c.diff?cvsroot=gcc&r1=1.146&r2=1.147
Richard, it looks like you checked in a fix here. If so, would you please close the PR?
Fixed.