Bug 59222 - [4.9 Regression] gcc.c-torture/compile/20050622-1.c ICEs at -O1 and above for aarch64-elf ILP32
Summary: [4.9 Regression] gcc.c-torture/compile/20050622-1.c ICEs at -O1 and above for...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: 4.9.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2013-11-21 02:25 UTC by Andrew Pinski
Modified: 2014-02-27 17:44 UTC (History)
3 users (show)

See Also:
Host:
Target: aarch64-elf
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-02-07 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2013-11-21 02:25:05 UTC
Executing on host: aarch64-thunder-elf-gcc  -fno-diagnostics-show-caret -fdiagnostics-color=never   -O1  -w -c   -o 20050622-1.o /home/apinski/src/gcc-cavium/toolchain-thunder/src/gcc/testsuite/gcc.c-torture/compile/20050622-1.c    (timeout = 300)
spawn aarch64-thunder-elf-gcc -fno-diagnostics-show-caret -fdiagnostics-color=never -O1 -w -c -o 20050622-1.o /home/apinski/src/gcc-cavium/toolchain-thunder/src/gcc/testsuite/gcc.c-torture/compile/20050622-1.c
/home/apinski/src/gcc-cavium/toolchain-thunder/src/gcc/testsuite/gcc.c-torture/compile/20050622-1.c: In function 'foo':
/home/apinski/src/gcc-cavium/toolchain-thunder/src/gcc/testsuite/gcc.c-torture/compile/20050622-1.c:16:1: internal compiler error: in gen_add2_insn, at optabs.c:4713
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://www.cavium.com/support.html> for instructions.
compiler exited with status 1
output is:
/home/apinski/src/gcc-cavium/toolchain-thunder/src/gcc/testsuite/gcc.c-torture/compile/20050622-1.c: In function 'foo':
/home/apinski/src/gcc-cavium/toolchain-thunder/src/gcc/testsuite/gcc.c-torture/compile/20050622-1.c:16:1: internal compiler error: in gen_add2_insn, at optabs.c:4713
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://www.cavium.com/support.html> for instructions.

FAIL: gcc.c-torture/compile/20050622-1.c  -O1  (internal compiler error)
FAIL: gcc.c-torture/compile/20050622-1.c  -O1  (test for excess errors)
Comment 1 Andrew Pinski 2013-12-04 23:13:03 UTC
This only happens with ILP32, I had originally misconfigured my compiler to default to ILP32.
Comment 2 Andrew Pinski 2013-12-05 00:38:07 UTC
Full backtrace:
(gdb) bt
#0  fancy_abort (file=0xe48128 "/data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/optabs.c", line=4716, function=0xe48c0a "gen_add2_insn")
    at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/diagnostic.c:1182
#1  0x00000000007b44ce in gen_add2_insn (x=0x7ffff7e50ca0, y=0x7ffff7e49800) at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/optabs.c:4716
#2  0x0000000000755b53 in emit_add2_insn (x=0x7ffff7e50ca0, y=0x7ffff7e49800) at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/lra.c:277
#3  0x0000000000758db5 in lra_emit_add (x=0x7ffff7e50ca0, y=0x7ffff7a69108, z=0x7ffff7e49800) at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/lra.c:354
#4  0x0000000000768922 in curr_insn_transform () at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/lra-constraints.c:3507
#5  0x000000000076a215 in lra_constraints (first_p=<value optimized out>) at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/lra-constraints.c:4049
#6  0x0000000000757e86 in lra (f=<value optimized out>) at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/lra.c:2331
#7  0x000000000071cc27 in do_reload (this=<value optimized out>) at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/ira.c:5451
#8  rest_of_handle_reload (this=<value optimized out>) at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/ira.c:5580
#9  execute (this=<value optimized out>) at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/ira.c:5609
#10 0x00000000007d499a in execute_one_pass (pass=0x13c19e0) at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/passes.c:2215
#11 0x00000000007d4c26 in execute_pass_list (pass=0x13c19e0) at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/passes.c:2268
#12 0x00000000007d4c38 in execute_pass_list (pass=0x13c0900) at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/passes.c:2269
#13 0x000000000055fe39 in expand_function (node=0x7ffff7c667b0) at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/cgraphunit.c:1763
#14 0x0000000000561ce1 in expand_all_functions () at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/cgraphunit.c:1868
#15 compile () at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/cgraphunit.c:2203
#16 0x000000000056338a in finalize_compilation_unit () at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/cgraphunit.c:2280
#17 0x00000000004143a3 in c_write_global_declarations () at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/c/c-decl.c:10399
#18 0x000000000087463d in compile_file () at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/toplev.c:561
#19 0x0000000000875816 in do_compile (argc=4, argv=0x7fffffffe0f8) at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/toplev.c:1887
#20 toplev_main (argc=4, argv=0x7fffffffe0f8) at /data1/src/gcc-cavium/toolchain-thunder/scripts/../src/gcc/toplev.c:1963
#21 0x0000000000d51fee in __libc_start_main ()
#22 0x0000000000400349 in _start ()

So this is a LRA related failure.
Comment 3 Andrew Pinski 2013-12-05 01:25:49 UTC
(gdb) p icode
$1 = CODE_FOR_addsi3
(gdb) p debug_rtx(x)
(reg:SI 86)
$2 = void
(gdb) p debug_rtx(y)
(const_int 75497488 [0x4800010])
Comment 4 Ramana Radhakrishnan 2014-02-07 10:51:17 UTC
Adding Vlad and Yvan to the cc list as they've been looking at LRA for AArch64.
Comment 5 Vladimir Makarov 2014-02-27 17:06:34 UTC
Author: vmakarov
Date: Thu Feb 27 17:06:02 2014
New Revision: 208201

URL: http://gcc.gnu.org/viewcvs?rev=208201&root=gcc&view=rev
Log:
2014-02-27  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/59222
	* lra.c (lra_emit_add): Check SUBREG too.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lra.c
Comment 6 Jeffrey A. Law 2014-02-27 17:44:04 UTC
Fixed by Vlad's commit.