4.7: ICE in reload_cse_simplify_operands, at postreload.c:403 with -O1 -march=armv7-a -mthumb

Bug #1046999 reported by Bernhard Rosenkraenzer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro Android
Fix Released
Critical
Bernhard Rosenkraenzer
Linaro GCC
Fix Released
High
Michael Hope
gcc
Fix Released
Medium

Bug Description

New issue in current bzr builds -- the 12.08 release is fine:

cts/apps/CtsVerifier/lib/colorchecker/colorcheckertest.cpp:425:1: error: insn does not satisfy its constraints:
(insn 5241 5240 147 2 (set (zero_extract:SI (reg/f:SI 13 sp)
            (const_int 16 [0x10])
            (const_int 16 [0x10]))
        (const_int 65535 [0xffff])) cts/apps/CtsVerifier/lib/colorchecker/colorcheckertest.cpp:256 348 {*arm_movtas_ze}
     (nil))
cts/apps/CtsVerifier/lib/colorchecker/colorcheckertest.cpp:425:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:403

Revision history for this message
Bernhard Rosenkraenzer (berolinux) wrote :
Revision history for this message
Bernhard Rosenkraenzer (berolinux) wrote :

Attaching reduced test case:

[bero@localhost grouper-4.1.1]$ /opt/android-toolchain-4.7/bin/arm-linux-androideabi-g++ -O1 -mthumb -march=armv7-a -c bug1046999.cc -o bug1046999.o
bug1046999.cc: In function 'void bug1046999()':
bug1046999.cc:12:1: error: insn does not satisfy its constraints:
(insn 121 120 52 2 (set (zero_extract:SI (reg/f:SI 13 sp)
            (const_int 16 [0x10])
            (const_int 16 [0x10]))
        (const_int 65535 [0xffff])) bug1046999.cc:3 348 {*arm_movtas_ze}
     (nil))
bug1046999.cc:12:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:403
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Changed in linaro-android:
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Bernhard Rosenkraenzer (berolinux)
milestone: none → 12.09
Revision history for this message
Michael Hope (michaelh1) wrote :

Thank you for the bug report. I've confirmed this with gcc-linaro-4.7+bzr115016.

michaelh@crucis:~/linaro/bugs$ ~/linaro/gcc/build/4.7/install/bin/arm-linux-gnueabi-g++ -O1 -S bug1046999.cc
bug1046999.cc: In function ‘void bug1046999()’:
bug1046999.cc:12:1: error: insn does not satisfy its constraints:
(insn 117 116 48 2 (set (zero_extract:SI (reg/f:SI 13 sp)
            (const_int 16 [0x10])
            (const_int 16 [0x10]))
        (const_int 65535 [0xffff])) bug1046999.cc:3 348 {*arm_movtas_ze}
     (nil))
bug1046999.cc:12:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:403

The fault is introduced by bzr115014 and is caused by the new add pattern not handling a sp = rx + constant pattern, causing reload to turn this into a movw, movt, and add. The pattern above is the movt part.

The fault exists upstream as at svn191044. Could you report it in GCC bugzilla and record it against this ticket?

I've set this to high priority as it's an ICE with no work around.

Revision history for this message
Michael Hope (michaelh1) wrote :

Oh, and the fault was introduced in svn190472 by rearnshaw.

Changed in gcc-linaro:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Michael Hope (michaelh1) wrote :

It seems that the r/r/k patterns used for other forms also need doing for the add. A shortcut is to remove the k constraint from the first operand, forcing sp adds to use a later alternative.

Michael Hope (michaelh1)
Changed in gcc-linaro:
assignee: nobody → Michael Hope (michaelh1)
status: Triaged → In Progress
Revision history for this message
In , Bernhard Rosenkraenzer (berolinux) wrote :

Created attachment 28143
Reduced test case

$ arm-linux-gnueabi-g++ -O1 -march=armv7-a -mthumb -S ice.cc
ice.cc: In function 'void bug1046999()':
ice.cc:12:1: error: insn does not satisfy its constraints:
(insn 121 120 52 2 (set (zero_extract:SI (reg/f:SI 13 sp)
            (const_int 16 [0x10])
            (const_int 16 [0x10]))
        (const_int 65535 [0xffff])) bug1046999.cc:3 348 {*arm_movtas_ze}
     (nil))
ice.cc:12:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:403
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Introduced in svn rev 190472

Revision history for this message
Bernhard Rosenkraenzer (berolinux) wrote :
Revision history for this message
In , Rearnsha (rearnsha) wrote :

Confirmed.

Revision history for this message
In , Rearnsha (rearnsha) wrote :

Nothing to do with gcc-4.7

Revision history for this message
Michael Hope (michaelh1) wrote :

Marked as affecting. Will bring up at todays meeting. Revert underway.

Changed in gcc:
importance: Unknown → Medium
status: Unknown → In Progress
Revision history for this message
Michael Hope (michaelh1) wrote :

Reverted.

Changed in gcc-linaro:
milestone: none → 4.7-2012.09
status: In Progress → Fix Committed
Michael Hope (michaelh1)
Changed in gcc-linaro:
status: Fix Committed → Fix Released
Revision history for this message
In , Rearnsha (rearnsha) wrote :

Author: rearnsha
Date: Fri Sep 14 17:10:45 2012
New Revision: 191307

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191307
Log:
 PR target/54516
 PR rtl-optimization/54540
 * reload.c (find_dummy_reload): Don't use OUT as a reload reg
 for IN if it overlaps a fixed register.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/reload.c

Revision history for this message
In , Rearnsha (rearnsha) wrote :

Fixed

Changed in gcc:
status: In Progress → Fix Released
Zach Pfeffer (pfefferz)
Changed in linaro-android:
status: Triaged → Fix Committed
Changed in linaro-android:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.