Bug 15693 - [3.3/3.4 regression] ICE - unrecognizable insn
Summary: [3.3/3.4 regression] ICE - unrecognizable insn
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.3.4
: P1 critical
Target Milestone: 3.3.4
Assignee: Eric Botcazou
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2004-05-27 21:26 UTC by Debian GCC Maintainers
Modified: 2004-10-30 21:10 UTC (History)
1 user (show)

See Also:
Host: sparc-*-*
Target: sparc-*-*
Build: sparc-*-*
Known to work: 3.3.2 4.0.0
Known to fail: 3.3.3 3.3.4 3.4.0 3.4.1
Last reconfirmed: 2004-05-27 21:35:43


Attachments
proposed patch (1.25 KB, patch)
2004-05-31 19:33 UTC, Debian GCC Maintainers
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Debian GCC Maintainers 2004-05-27 21:26:07 UTC
[forwarded from http://bugs.debian.org/250899]

distilled from the 2.6.7-rc1 kernel, built for sparc-linux (mm/fremap.c),
compiled with -O2 or -O3, works with -O0, -O1

3.3 branch, 20040517 or later, 20040429 is reported to work.

static __inline__ __attribute__ ((always_inline))
int page_mapping (unsigned flags)
{
  if (1u & (flags >> 16))
    return 1;
  return 0;
}
void install_page (unsigned flags)
{
  if (__builtin_expect (!page_mapping (flags), 0))
    __builtin_trap ();
}

$gcc -O2 bug-250899.c
bug-250899.c: In function `install_page':
bug-250899.c:12: error: unrecognizable insn:
(insn 53 16 54 0 0x701cf180 (set (reg:SI 112)
        (zero_extract:SI (reg:SI 110)
            (const_int 1 [0x1])
            (const_int 31 [0x1f]))) -1 (nil)
    (expr_list:REG_DEAD (reg:SI 110)
        (nil)))
bug-250899.c:12: internal compiler error: in extract_insn, at recog.c:2175
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Eric Botcazou 2004-05-27 21:35:42 UTC
Confirmed.  Critical since it's the Kernel.
Comment 2 Eric Botcazou 2004-05-27 21:36:13 UTC
Investigating.
Comment 3 Eric Botcazou 2004-05-27 22:54:39 UTC
The latest version reported to work seems dubious.  According to my testing, GCC
3.3.2 compiles the testcase but not GCC 3.3.3.
Comment 4 Eric Botcazou 2004-05-28 05:52:51 UTC
Ironically, the ICE was introduced/exposed by:

2004-01-11  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/13392
	* builtins.c (expand_builtin_expect_jump): Handle conditional jumps
	to drop through label.  Don't fall back to SCC even when conditional
	jump has not been found.
Comment 5 Eric Botcazou 2004-05-31 19:25:51 UTC
Proposed fix: http://gcc.gnu.org/ml/gcc/2004-05/msg01424.html
Comment 6 Debian GCC Maintainers 2004-05-31 19:33:02 UTC
Created attachment 6439 [details]
proposed patch
Comment 7 GCC Commits 2004-05-31 21:34:30 UTC
Subject: Bug 15693

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ebotcazou@gcc.gnu.org	2004-05-31 21:34:27

Modified files:
	gcc            : ChangeLog 
	gcc/testsuite  : ChangeLog 
	gcc/config/sparc: sparc.c sparc.h sparc.md 
Added files:
	gcc/testsuite/gcc.dg: sparc-trap-1.c 

Log message:
	PR target/15693
	* config/sparc/sparc.c (compare_operand): New predicate.
	* config/sparc/sparc.h (PREDICATE_CODES): Add it.
	* config/sparc/sparc.md (cmpsi expander): Use it.  If the first
	operand is a ZERO_EXTRACT and the second operand is not zero,
	force the former to a register.
	(cmpdi expander): Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3807&r2=2.3808
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3797&r2=1.3798
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/sparc-trap-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.c.diff?cvsroot=gcc&r1=1.300&r2=1.301
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.h.diff?cvsroot=gcc&r1=1.252&r2=1.253
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.md.diff?cvsroot=gcc&r1=1.201&r2=1.202

Comment 8 GCC Commits 2004-05-31 21:40:24 UTC
Subject: Bug 15693

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	ebotcazou@gcc.gnu.org	2004-05-31 21:40:20

Modified files:
	gcc            : ChangeLog 
	gcc/testsuite  : ChangeLog 
	gcc/config/sparc: sparc.c sparc.h sparc.md 
Added files:
	gcc/testsuite/gcc.dg: sparc-trap-1.c 

Log message:
	PR target/15693
	* config/sparc/sparc.c (compare_operand): New predicate.
	* config/sparc/sparc.h (PREDICATE_CODES): Add it.
	* config/sparc/sparc.md (cmpsi expander): Use it.  If the first
	operand is a ZERO_EXTRACT and the second operand is not zero,
	force the former to a register.
	(cmpdi expander): Likewise.

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.457&r2=2.2326.2.458
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.188&r2=1.3389.2.189
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/sparc-trap-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.271.4.13&r2=1.271.4.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.236.6.6&r2=1.236.6.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.md.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.196.2.2&r2=1.196.2.3

Comment 9 GCC Commits 2004-05-31 21:45:36 UTC
Subject: Bug 15693

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	ebotcazou@gcc.gnu.org	2004-05-31 21:45:33

Modified files:
	gcc            : ChangeLog 
	gcc/testsuite  : ChangeLog 
	gcc/config/sparc: sparc.c sparc.h sparc.md 
Added files:
	gcc/testsuite/gcc.dg: sparc-trap-1.c 

Log message:
	PR target/15693
	* config/sparc/sparc.c (compare_operand): New predicate.
	* config/sparc/sparc.h (PREDICATE_CODES): Add it.
	* config/sparc/sparc.md (cmpsi expander): Use it.  If the first
	operand is a ZERO_EXTRACT and the second operand is not zero,
	force the former to a register.
	(cmpdi expander): Likewise.

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.988&r2=1.16114.2.989
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.376&r2=1.2261.2.377
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/sparc-trap-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.4.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.233.4.9&r2=1.233.4.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.h.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.215.4.5&r2=1.215.4.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.md.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.181.4.10&r2=1.181.4.11

Comment 10 Eric Botcazou 2004-05-31 21:57:34 UTC
Proposed fix applied.