Bug 15550 - [3.4 Regression] [i386] ICE in extract_insn, at recog.c:2083
Summary: [3.4 Regression] [i386] ICE in extract_insn, at recog.c:2083
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.1
Assignee: Richard Henderson
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2004-05-20 07:46 UTC by Danny Smith
Modified: 2004-09-09 23:40 UTC (History)
1 user (show)

See Also:
Host: i686-pc-mingw32
Target: i686-pc-mingw32
Build: i686-pc-mingw32
Known to work: 4.0 3.3.3
Known to fail: 3.4.0
Last reconfirmed: 2004-05-20 11:26:32


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Danny Smith 2004-05-20 07:46:06 UTC
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
Comment 1 Andrew Pinski 2004-05-20 11:26:31 UTC
Confirmed.
Comment 2 Mark Mitchell 2004-06-12 22:10:00 UTC
Richard, this is another IA32 backend issue.
Comment 3 Richard Henderson 2004-06-13 02:20:41 UTC
Testing a patch.
Comment 4 Mark Mitchell 2004-06-19 17:47:04 UTC
How did the patch turn out?
Comment 5 GCC Commits 2004-06-19 19:09:00 UTC
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

Comment 6 GCC Commits 2004-06-19 19:13:09 UTC
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

Comment 7 Mark Mitchell 2004-06-21 21:36:27 UTC
Richard, it looks like you checked in a fix here.  If so, would you please close
the PR?
Comment 8 Richard Henderson 2004-06-21 21:47:46 UTC
Fixed.