Bug 54892 - [4.7/4.8 Regression], ICE in extract_insn, at recog.c:2123
Summary: [4.7/4.8 Regression], ICE in extract_insn, at recog.c:2123
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.7.2
: P3 normal
Target Milestone: 4.7.3
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2012-10-10 16:16 UTC by Matthias Klose
Modified: 2012-10-23 09:14 UTC (History)
3 users (show)

See Also:
Host:
Target: arm-linux-gnueabi
Build:
Known to work: 4.6.3
Known to fail: 4.7.2, 4.8.0
Last reconfirmed:


Attachments
preprocessed source (159.82 KB, application/x-xz)
2012-10-10 16:16 UTC, Matthias Klose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2012-10-10 16:16:37 UTC
Created attachment 28414 [details]
preprocessed source

seen on arm-linux-gnueabi, works with the 4.6 branch, fails with the 4.7 branch:


$ g++-4.7 -c -g cluster.ii cluster.cc: In member function 'bool rpc::node::set_role(rpc::role_type)':
cluster.cc:88:1: error: unrecognizable insn:
(insn 16 15 17 3 (parallel [
            (set (reg:CC_Z 24 cc)
                (unspec_volatile:CC_Z [
                        (const_int 0 [0])
                    ] VUNSPEC_ATOMIC_CAS))
            (set (reg:SI 146)
                (zero_extend:SI (mem/v:HI (reg/f:SI 134 [ D.146641 ]) [-1 S2 A16])))
            (set (mem/v:HI (reg/f:SI 134 [ D.146641 ]) [-1 S2 A16])
                (unspec_volatile:HI [
                        (reg:HI 147)
                        (subreg/s/u:HI (reg:SI 135 [ D.146642 ]) 0)
                        (const_int 0 [0])
                        (const_int 5 [0x5])
                        (const_int 5 [0x5])
                    ] VUNSPEC_ATOMIC_CAS))
            (clobber (scratch:SI))
        ]) cluster.cc:87 -1
     (nil))
cluster.cc:88:1: internal compiler error: in extract_insn, at recog.c:2123
Please submit a full bug report,
Comment 1 Mikael Pettersson 2012-10-13 16:03:37 UTC
I can reproduce the ICE with g++ 4.8-20121007 and 4.7-20121006, on arm-linux-gnueabi with -march=armv7-a; with -march=armv6 or armv5te it doesn't ICE.  The preprocessed source doesn't compile with g++ 4.6 so I can't check there.
Comment 2 Mikael Pettersson 2012-10-13 21:35:21 UTC
The ICE started with Richard Henderson's "[ARM] Convert to atomic optabs" patch in r183050:
http://gcc.gnu.org/ml/gcc-patches/2012-01/msg00288.html
http://gcc.gnu.org/ml/gcc-cvs/2012-01/msg00290.html
Comment 3 xuepeng guo 2012-10-19 09:24:48 UTC
Author: xguo
Date: Fri Oct 19 09:24:39 2012
New Revision: 192609

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192609
Log:
	gcc/ChangeLog
	PR target/54892
	* config/arm/arm.c (arm_expand_compare_and_swap): Use SImode to make
	sure the mode is correct when falling through from above cases.

	gcc/testsuite/ChangeLog
	PR target/54892
	* gcc.target/arm/pr54892.c: New.

Added:
    trunk/gcc/testsuite/gcc.target/arm/pr54892.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/arm/arm.c
    trunk/gcc/testsuite/ChangeLog
Comment 4 xuepeng guo 2012-10-19 09:39:20 UTC
Author: xguo
Date: Fri Oct 19 09:39:13 2012
New Revision: 192610

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192610
Log:
	gcc/ChangeLog
	Backported from mainline
	2012-10-19  Zhenqiang Chen <zhenqiang.chen@linaro.org>

	PR target/54892
	* config/arm/arm.c (arm_expand_compare_and_swap): Use SImode to make
	sure the mode is correct when falling through from above cases.

	gcc/testsuite/ChangeLog
	Backported from mainline
	2012-10-19  Zhenqiang Chen <zhenqiang.chen@linaro.org>

	PR target/54892
	* gcc.target/arm/pr54892.c: New.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/gcc.target/arm/pr54892.c
Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/config/arm/arm.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
Comment 5 Jakub Jelinek 2012-10-23 09:14:03 UTC
Assuming fixed.