ICE in reload_cse_simplify_operands when compiling with -marm -mfpu=neon

Reported by Juha Kallioinen on 2011-02-22
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GCC
Medium
Richard Sandiford
4.5
Medium
Richard Sandiford
4.6
Medium
Richard Sandiford
gcc
Fix Released
Medium

Bug Description

I'm getting an ICE in Natty with the gcc-4.4 and gcc-4.5 arm cross compilers:

$ arm-linux-gnueabi-gcc-4.4 --version
arm-linux-gnueabi-gcc-4.4 (Ubuntu/Linaro 4.4.5-10ubuntu2) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ arm-linux-gnueabi-gcc-4.4 -marm -mfpu=neon -O2 -g -c epoll-ltp.i
epoll-ltp.c: In function ‘test_epoll_ctl’:
epoll-ltp.c:651: error: insn does not satisfy its constraints:
(insn 123 1018 125 9 epoll-ltp.c:453 (set (mem/s:DI (plus:SI (reg:SI 12 ip)
                (const_int -7 [0xfffffffffffffff9])) [0 <variable>.data.u64+0 S8 A64])
        (reg:DI 2 r2)) 600 {*arm_movdi_vfp_cortexa8} (expr_list:REG_EQUAL (const_int 0 [0x0])
        (nil)))
epoll-ltp.c:651: internal compiler error: in reload_cse_simplify_operands, at postreload.c:397
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.

$ arm-linux-gnueabi-gcc-4.5 --version
arm-linux-gnueabi-gcc-4.5 (Ubuntu/Linaro 4.5.2-1ubuntu6) 4.5.2
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ arm-linux-gnueabi-gcc-4.5 -marm -mfpu=neon -O2 -g -c epoll-ltp.i
epoll-ltp.c: In function ‘test_epoll_ctl’:
epoll-ltp.c:651:1: error: insn does not satisfy its constraints:
(insn 159 1013 160 9 epoll-ltp.c:453 (set (mem/s:DI (plus:SI (reg:SI 12 ip)
                (const_int -7 [0xfffffffffffffff9])) [0 unaligned_event_ptr_63->data.u64+0 S8 A64])
        (reg:DI 2 r2 [372])) 593 {*arm_movdi_vfp_cortexa8} (expr_list:REG_EQUAL (const_int 0 [0x0])
        (nil)))
epoll-ltp.c:651:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:402
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.5/README.Bugs> for instructions.

Perhaps this upstream bug is related or duplicate: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42949

Michael Hope (michaelh1) wrote :

Confirmed in gcc-linaro-4.5-2011.02-0:

michaelh@ursa1:~/linaro/bugs$ /tools/toolchains/gcc-linaro-4.5-2011.02-0-armv7l-maverick-cbuild46-pavo3-cortexa8r1/bin/gcc -marm -mfpu=neon -O2 -g -c epoll-ltp.i
epoll-ltp.c: In function 'test_epoll_ctl':
epoll-ltp.c:651:1: error: insn does not satisfy its constraints:
(insn 159 1013 160 9 epoll-ltp.c:453 (set (mem/s:DI (plus:SI (reg:SI 12 ip)
                (const_int -7 [0xfffffffffffffff9])) [0 unaligned_event_ptr_63->data.u64+0 S8 A64])
        (reg:DI 2 r2 [372])) 593 {*arm_movdi_vfp_cortexa8} (expr_list:REG_EQUAL (const_int 0 [0x0])
        (nil)))
epoll-ltp.c:651:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:402
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Thumb-2 mode is fine:

michaelh@ursa1:~/linaro/bugs$ /tools/toolchains/gcc-linaro-4.5-2011.02-0-armv7l-maverick-cbuild46-pavo3-cortexa8r1/bin/gcc -mthumb -mfpu=neon -O2 -g -c epoll-ltp.i
michaelh@ursa1:~/linaro/bugs$

VFP only is fine.

Changed in gcc-linaro:
status: New → Triaged
importance: Undecided → Medium

I see this on FSF trunk also (svn r171251).

Michael Hope (michaelh1) wrote :

Andrew, can you create a ticket upstream and attach it to this bug please?

I've attached a somewhat reduced testcase.

Created attachment 23755
Reduced testcase.

Using a trunk (svn 171251) compiler, configured for ARMv7-a, I get the following ICE:

gcc -marm -mfpu=neon -O2 -c lp723185.i

lp723185.i: In function 'foo':
lp723185.i:29:1: error: insn does not satisfy its constraints:
(insn 30 79 31 5 (set (mem/s:DI (plus:SI (reg:SI 3 r3)
                (const_int -3 [0xfffffffffffffffd])) [4 unaligned_S_6->u64+0 S8 A64])
        (reg:DI 4 r4 [146])) lp723185.i:25 626 {*arm_movdi_vfp}
     (nil))
lp723185.i:29: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.

It's possible that this is the same as bug #42949, but I'm not qualified to judge.

Chung-Lin Tang (cltang) wrote :

I have a patch for this under testing.
Thanks for the much reduced testcase Andrew :)

Changed in gcc:
importance: Unknown → Medium
status: Unknown → New
In , Ibolton (ibolton) wrote :

Confirmed on trunk, r171212.

Works on latest 4.5 (r171282).

I don't think this is the same bug as PR42949 because that one has now ceased to occur - for me at least.

Changed in gcc:
status: New → Confirmed
Michael Hope (michaelh1) on 2011-03-31
Changed in gcc-linaro:
assignee: nobody → Chung-Lin Tang (cltang)

Author: cltang
Date: Tue Apr 12 04:42:55 2011
New Revision: 172297

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172297
Log:
2011-04-11 Chung-Lin Tang <email address hidden>
     Richard Earnshaw <email address hidden>

 PR target/48250
 * config/arm/arm.c (arm_legitimize_reload_address): Update cases
 to use sign-magnitude offsets. Reject unsupported unaligned
 cases. Add detailed description in comments.
 * config/arm/arm.md (reload_outdf): Disable for ARM mode; change
 condition from TARGET_32BIT to TARGET_ARM.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/arm/arm.c
    trunk/gcc/config/arm/arm.md

I am out of the office until 17/04/2011.

Note: This is an automated response to your message "[Bug 723185]" sent on
12/4/2011 7:43:01.

This is the only notification you will receive while this person is away.

Michael Hope (michaelh1) wrote :

Acceptance is here:
 http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00739.html

Chung-Lin, could you organise a backport for next month's release please?

Changed in gcc-linaro:
status: Triaged → In Progress
milestone: none → 4.5-2011.05-0

Fixed on trunk .

Needs backporting to 4.6 branch.

Ramana

A backport to 4.6 shows the following failures -

arm-sim: gcc.c-torture/execute/loop-ivopts-2.c compilation, -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions (internal compiler error)
arm-sim: gcc.c-torture/execute/loop-ivopts-2.c compilation, -O3 -fomit-frame-pointer -funroll-loops (internal compiler error)
arm-sim: gcc.c-torture/execute/loop-ivopts-2.c compilation, -O3 -fomit-frame-pointer (internal compiler error)
arm-sim: gcc.c-torture/execute/loop-ivopts-2.c compilation, -O3 -g (internal compiler error)
arm-sim: gcc.c-torture/execute/pr23135.c compilation, -O1 (internal compiler error)

 I'll dig further when I have a little more time

ackport-test-armv7aneon/gcc3/gcc/ /home/ramana/cross-build/src/gcc-workarea-2/gcc.c-torture/execute/loop-ivopts-2.c gcc_tg.o -w -O3 -fomit-frame-pointer -DSTACK_SIZE=16384 -Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -lm -o /home/ramana/cross-build/arm-none-linux-gnueabi/obj-gcc46-backport-test-armv7aneon/gcc3/gcc/testsuite/gcc2/loop-ivopts-2.x3 (timeout = 800)
/home/ramana/cross-build/src/gcc-workarea-2/gcc/testsuite/gcc.c-torture/execute/loop-ivopts-2.c: In function ‘main’:
/home/ramana/cross-build/src/gcc-workarea-2/gcc/testsuite/gcc.c-torture/execute/loop-ivopts-2.c:49:1: error: insn does not satisfy its constraints:
(insn 123 122 67 6 (set (mem/s/c:V2SI (plus:SI (reg:SI 1 r1)
                (const_int -1016 [0xfffffffffffffc08])) [2 MEM[(unsigned int[288] *)&l + 1032B]+0 S8 A64])
        (reg:V2SI 2 r2)) /home/ramana/cross-build/src/gcc-workarea-2/gcc/testsuite/gcc.c-torture/execute/loop-ivopts-2.c:44 742 {*neon_movv2si}
     (nil))

Changed in gcc:
status: Confirmed → In Progress

I was not able to reproduce these ICEs, tried backporting to both mainline gcc-4_6-branch and a latest Linaro 4.6 pull.

Michael Hope (michaelh1) wrote :

For reference, this bug exists in the gcc-linaro-{4.5,4.6}-2011.05 releases:

michaelh@ursa2:~/linaro/bugs$ /tools/toolchains/arch/armv7l/gcc-linaro-4.6-2011.05-0-armv7l-maverick-cbuild114-ursa3-cortexa9r1/bin/gcc -c -O2 -marm -mfpu=neon epoll-ltp.i
epoll-ltp.c: In function 'test_epoll_ctl':
epoll-ltp.c:651:1: error: insn does not satisfy its constraints:
(insn 150 914 782 9 (set (mem/s:DI (plus:SI (reg:SI 14 lr)
                (const_int 1 [0x1])) [0 unaligned_event_ptr_63->data.u64+0 S8 A64])
        (reg:DI 2 r2 [372])) epoll-ltp.c:453 626 {*arm_movdi_vfp}
     (nil))
epoll-ltp.c:651:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:403

michaelh@ursa2:~/linaro/bugs$ /tools/toolchains/arch/armv7l/gcc-linaro-4.5-2011.05-0-armv7l-maverick-cbuild114-ursa4-cortexa9r1/bin/gcc -c -O2 -marm -mfpu=neon epoll-ltp.i
epoll-ltp.c: In function 'test_epoll_ctl':
epoll-ltp.c:651:1: error: insn does not satisfy its constraints:
(insn 143 917 767 9 epoll-ltp.c:453 (set (mem/s:DI (plus:SI (reg:SI 1 r1)
                (const_int -7 [0xfffffffffffffff9])) [0 unaligned_event_ptr_63->data.u64+0 S8 A64])
        (reg:DI 2 r2 [372])) 638 {*arm_movdi_vfp} (expr_list:REG_EQUAL (const_int 0 [0x0])
        (nil)))
epoll-ltp.c:651:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:402

Michael Hope (michaelh1) wrote :

Hi Juha. This has been fixed in trunk and backported to gcc-linaro 4.6. Do you need it in 4.5 as well?

Michael, yes I'd be very interested in a patch for 4.5 as well.

I'm getting this ICE currently when using Linaro gcc-4.5 2011.05 and compiling the tests in gstreamer0.10 (http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-0.10.34.tar.bz2). The workaround is known, but still it's a bit of a bother to have to apply it.

Hi, I guess this is now fixed also for gcc 4.5? I don't get the crash with Linaro gcc 4.5 2011.08 with my test case anymore.

Michael Hope (michaelh1) wrote :

Hi Juha. Yes, the fix was released in gcc-linaro-4.5-2011.07. I'm afraid I don't know the state of the Ubuntu packages.

In , Jye2 (jye2) wrote :

Author: jye2
Date: Mon Sep 19 06:17:45 2011
New Revision: 178953

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178953
Log:
2011-09-19 chengbin <email address hidden>

 Backport r174035 from mainline
 2011-05-22 Tom de Vries <email address hidden>

 PR middle-end/48689
 * fold-const.c (fold_checksum_tree): Guard TREE_CHAIN use with
 CODE_CONTAINS_STRUCT (TS_COMMON).

 Backport r172297 from mainline
 2011-04-11 Chung-Lin Tang <email address hidden>
  Richard Earnshaw <email address hidden>

 PR target/48250
 * config/arm/arm.c (arm_legitimize_reload_address): Update cases
 to use sign-magnitude offsets. Reject unsupported unaligned
 cases. Add detailed description in comments.
 * config/arm/arm.md (reload_outdf): Disable for ARM mode; change
 condition from TARGET_32BIT to TARGET_ARM.

 Backport r171978 from mainline
 2011-04-05 Tom de Vries <email address hidden>

 PR target/43920
 * config/arm/arm.h (BRANCH_COST): Set to 1 for Thumb-2 when optimizing
 for size.

 Backport r171632 from mainline
 2011-03-28 Richard Sandiford <email address hidden>

 * builtins.c (expand_builtin_memset_args): Use gen_int_mode
 instead of GEN_INT.

 Backport r171379 from mainline
 2011-03-23 Chung-Lin Tang <email address hidden>

 PR target/46934
 * config/arm/arm.md (casesi): Use the gen_int_mode() function
 to subtract lower bound instead of GEN_INT().

 Backport r171251 from mainline
 2011-03-21 Daniel Jacobowitz <email address hidden>

 * config/arm/unwind-arm.c (__gnu_unwind_pr_common): Correct test
 for barrier handlers.

 Backport r171096 from mainline
 2011-03-17 Chung-Lin Tang <email address hidden>

 PR target/43872
 * config/arm/arm.c (arm_get_frame_offsets): Adjust early
 return condition with !cfun->calls_alloca.

Modified:
    branches/ARM/embedded-4_6-branch/gcc/ChangeLog.arm
    branches/ARM/embedded-4_6-branch/gcc/builtins.c
    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/config/arm/unwind-arm.c
    branches/ARM/embedded-4_6-branch/gcc/fold-const.c
    branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.target/arm/pr40887.c
    branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.target/arm/pr42575.c
    branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.target/arm/pr43698.c
    branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.target/arm/pr44788.c
    branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.target/arm/sync-1.c

Fixed on 4.7.0 - wont fix on 4.6.x

Changed in gcc:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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