Bug 49049 - ICE in copyprop_hardreg_forward_1, at regcprop.c:767
Summary: ICE in copyprop_hardreg_forward_1, at regcprop.c:767
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-18 17:37 UTC by Ryan Mansfield
Modified: 2012-06-08 06:58 UTC (History)
5 users (show)

See Also:
Host: x86_64-linux-gnu
Target: arm-unknown-linux-gnueabi
Build: x86_64-linux-gnu
Known to work:
Known to fail: 4.7.0
Last reconfirmed: 2011-05-20 09:53:22


Attachments
preprocessed source (253 bytes, text/plain)
2011-05-18 17:37 UTC, Ryan Mansfield
Details
preprocessed volume.i source (81.43 KB, application/x-gzip)
2011-07-21 08:31 UTC, Matthias Klose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Mansfield 2011-05-18 17:37:17 UTC
Created attachment 24285 [details]
preprocessed source

$ ./xgcc -v
Using built-in specs.
COLLECT_GCC=./xgcc
Target: arm-unknown-linux-gnueabi
Configured with: ../configure --target=arm-unknown-linux-gnueabi --prefix=/home/ryan/x-tools/arm-unknown-linux-gnueabi --with-sysroot=/home/ryan/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi//sys-root --disable-multilib --with-local-prefix=/home/ryan/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sys-root --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-c99 --enable-long-long --enable-target-optspace target_alias=arm-unknown-linux-gnueabi --enable-languages=c++ --disable-shared --disable-libmudflap --disable-libssp
Thread model: posix
gcc version 4.7.0 20110517 (experimental) [trunk revision 173832] (GCC) 
$ ./xgcc -B. ~/ice.i -O3
/home/ryan/ice.i: In function 'foo':
/home/ryan/ice.i:28:1: error: insn does not satisfy its constraints:
(insn 98 35 37 3 (set (reg:SI 4 r4 [195])
        (minus:SI (const_int 4 [0x4])
            (const_int 861 [0x35d]))) /home/ryan/ice.i:6 29 {*arm_subsi3_insn}
     (nil))
/home/ryan/ice.i:28:1: internal compiler error: in copyprop_hardreg_forward_1, at regcprop.c:767
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Ian Bolton 2011-05-20 09:53:22 UTC
Confirmed.  Note that it does not happen for -marm.

Full compilation command-line:

cc1 -fpreprocessed 49049.i -quiet -dumpbase 49049.i -mthumb -mcpu=cortex-a9 -mfloat-abi=softfp -mfpu=vfpv3-d16 -auxbase 49049 -O3 -version -o 49049.s
Comment 2 Ryan Mansfield 2011-05-20 13:07:17 UTC
With rev173940 I can reproduce it with -marm.

$ ./cc1 -quiet -fpreprocessed ice.i -O3 -marm 
ice.i: In function 'foo':
ice.i:28:1: error: insn does not satisfy its constraints:
(insn 98 35 37 3 (set (reg:SI 4 r4 [195])
        (minus:SI (const_int 4 [0x4])
            (const_int 861 [0x35d]))) ice.i:6 29 {*arm_subsi3_insn}
     (nil))
ice.i:28:1: internal compiler error: in copyprop_hardreg_forward_1, at regcprop.c:767
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 3 Ian Bolton 2011-05-20 13:50:56 UTC
Thanks for confirming that.

If I try "-marm -mcpu=arm7tdmi" I can get the ICE, but not with "-marm -mcpu=cortex-a9".
Comment 4 Matthias Klose 2011-07-21 08:28:41 UTC
[ http://bugs.debian.org/630746 ]

looks like a regression in current 4.6 branch and the trunk, works with current 4.4 and 4.5 branches. The volume.i builds with -O2 instead of -O1 (the Debian compiler targets armv4 by default).

$ gcc -g -O -c volume.i../vol/volume.c: In function 'VShutdown_r':
../vol/volume.c:1320:1: error: insn does not satisfy its constraints:
(insn 1117 1116 669 56 (set (reg:SI 8 r8 [561])
        (minus:SI (const_int 12 [0xc])
            (const_int 5784 [0x1698]))) ../vol/volume.c:1409 29 {*arm_subsi3_insn}
     (nil))
../vol/volume.c:1320:1: internal compiler error: in copyprop_hardreg_forward_1, at regcprop.c:767
Please submit a full bug report,
with preprocessed source if appropriate.
Comment 5 Matthias Klose 2011-07-21 08:31:56 UTC
Created attachment 24801 [details]
preprocessed volume.i source
Comment 6 Mikael Pettersson 2011-10-02 15:22:46 UTC
The first smaller test case started failing with r163935:
http://gcc.gnu.org/ml/gcc-cvs/2010-09/msg00227.html
Comment 7 Mikael Pettersson 2011-10-02 18:35:02 UTC
The second larger test case from Matthias started failing with r161831:
http://gcc.gnu.org/ml/gcc-cvs/2010-07/msg00185.html
Comment 8 Bernd Schmidt 2011-10-06 13:13:00 UTC
Author: bernds
Date: Thu Oct  6 13:12:50 2011
New Revision: 179607

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179607
Log:
	PR target/49049
	* config/arm/arm.md (arm_subsi3_insn): Lose the last alternative.

	* gcc.c-torture/compile/pr49049.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr49049.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/arm/arm.md
    trunk/gcc/testsuite/ChangeLog
Comment 9 Bernd Schmidt 2011-10-07 12:56:55 UTC
Author: bernds
Date: Fri Oct  7 12:56:52 2011
New Revision: 179657

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179657
Log:
 	PR target/49049
 	* config/arm/arm.md (arm_subsi3_insn): Lose the last alternative.

	* gcc.c-torture/compile/pr49049.c: New test.


Added:
    branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr49049.c
Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/config/arm/arm.md
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Comment 10 Bernd Schmidt 2011-10-07 13:07:02 UTC
Fixed.
Comment 11 jye2 2012-06-08 06:58:33 UTC
Author: jye2
Date: Fri Jun  8 06:58:25 2012
New Revision: 188327

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188327
Log:
Backport mainline r179607, r179979, r179980, r181416, r182014
2012-06-08  Joey Ye  <joey.ye@arm.com>

	Backport r182014 from mainline.
	2011-12-05  Kazu Hirata  <kazu@codesourcery.com>

	PR target/51408
	* config/arm/arm.md (*minmax_arithsi): Always require the else
	clause in the MINUS case.

	Backport r181416 from mainline.
	2011-11-16  Richard Earnshaw  <rearnsha@arm.com>
		Bernd Schmidt <bernds@coudesourcery.com>
		Sebastian Huber <sebastian.huber@embedded-brains.de>

	PR target/49641
	* config/arm/arm.c (store_multiple_sequence): Avoid cases where
	the base reg is stored iff compiling for Thumb1.

	Backport r179980 from mainline.
	2011-10-14  David Alan Gilbert  <david.gilbert@linaro.org>

	PR target/48126
	* config/arm/arm.c (arm_output_sync_loop): Move label before barrier.

	Backport r179979 from mainline.
	2011-10-14  David Alan Gilbert  <david.gilbert@linaro.org>

	* config/arm/arm.h (TARGET_HAVE_DMB_MCR): MCR Not available in Thumb1.

	Backport r179607 from mainline.
	2011-10-06  Bernd Schmidt  <bernds@codesourcery.com>

	PR target/49049
	* config/arm/arm.md (arm_subsi3_insn): Lose the last alternative.

Testsuites:
	Backport r182014 from mainline
	2011-12-05  Kazu Hirata  <kazu@codesourcery.com>

	PR target/51408
	* gcc.dg/pr51408.c: New.

	Backport r181416 from mainline
	2011-11-16  Richard Earnshaw  <rearnsha@arm.com>
		Bernd Schmidt <bernds@coudesourcery.com>
		Sebastian Huber <sebastian.huber@embedded-brains.de>

	PR target/49641
	* gcc.target/arm/pr49641.c: New test.

	Backport r179607 from mainline
	2011-10-06  Bernd Schmidt  <bernds@codesourcery.com>

	PR target/49049
	* gcc.c-torture/compile/pr49049.c: New test.


Added:
    branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr49049.c
    branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.dg/pr51408.c
    branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.target/arm/pr49641.c
Modified:
    branches/ARM/embedded-4_6-branch/gcc/ChangeLog.arm
    branches/ARM/embedded-4_6-branch/gcc/config/arm/arm.c
    branches/ARM/embedded-4_6-branch/gcc/config/arm/arm.h
    branches/ARM/embedded-4_6-branch/gcc/config/arm/arm.md
    branches/ARM/embedded-4_6-branch/gcc/testsuite/ChangeLog.arm