[Bug middle-end/59584] New: [4.9 Regression]: gcc.dg/pr50251.c ICE exposed by "Don't reject TER unnecessarily"

hp at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Dec 23 13:04:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59584

            Bug ID: 59584
           Summary: [4.9 Regression]: gcc.dg/pr50251.c ICE exposed by
                    "Don't reject TER unnecessarily"
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hp at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
              Host: x86_64-unknown-linux-gnu
            Target: cris-axis-elf

This test previously passed, now it fails.
A patch in the revision range (last_known_working:first_known_failing)
206008:206011 exposed or caused this regression.  Since then it fails as
follows:

Running /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/dg.exp ...
...
FAIL: gcc.dg/pr50251.c (internal compiler error)
FAIL: gcc.dg/pr50251.c (test for excess errors)


In gcc.log:
Executing on host: /tmp/hpautotest-gcc1/cris-elf/gccobj/gcc/xgcc
-B/tmp/hpautotest-gcc1/cris-elf/gccobj/gcc/
/tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c 
-fno-diagnostics-show-caret -fdiagnostics-color=never   -O2 -S   -isystem
/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/./newlib/targ-include -isystem
/tmp/hpautotest-gcc1/gcc/newlib/libc/include  -o pr50251.s    (timeout = 300)
/tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c: In function 'main':
/tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c:18:1: internal compiler
error: in fixup_args_size_notes, at expr.c:3978
0x698221 fixup_args_size_notes(rtx_def*, rtx_def*, int)
        /tmp/hpautotest-gcc1/gcc/gcc/expr.c:3978
0x67aef9 try_split(rtx_def*, rtx_def*, int)
        /tmp/hpautotest-gcc1/gcc/gcc/emit-rtl.c:3602
0x886e61 split_insn
        /tmp/hpautotest-gcc1/gcc/gcc/recog.c:2850
0x887104 split_all_insns()
        /tmp/hpautotest-gcc1/gcc/gcc/recog.c:2940
0x8871d2 rest_of_handle_split_after_reload
        /tmp/hpautotest-gcc1/gcc/gcc/recog.c:3889
0x8871d2 execute
        /tmp/hpautotest-gcc1/gcc/gcc/recog.c:3918
Please submit a full bug report,
with preprocessed source if appropriate.

(as the test-case is without preprocessing directives no such action necessary)

A few more hints from gdb shows that gcc ties itself in a knot when splitting:
 (set (reg/f:SI 14 sp) (mem/f/c:SI (symbol_ref:SI ("p")))
into:
(gdb) call debug_rtx_range (seq, 0)
(insn 33 0 34 (set (reg/f:SI 14 sp)
        (symbol_ref:SI ("p") <var_decl 0x7ffff7eb2000 p>)) -1
     (nil))

(insn 34 33 0 (set (reg/f:SI 14 sp)
        (mem/f/c:SI (reg/f:SI 14 sp) [2 p+0 S4 A8])) -1
     (expr_list:REG_ARGS_SIZE (const_int 0 [0])
        (nil)))

(nil)

While this define_split has a bug (by matching sp, allowing to set the stack
temporarily in an inconsistent state by using sp as a temporary for the
symbol), I doubt that's the actual bug causing internal inconsistency within
gcc.  Anyway:

(gdb) r -fpreprocessed pr50251.i -melf -quiet -dumpbase pr50251.c
-auxbase-strip pr50251.s -O2 -version -fno-diagnostics-show-caret
-fdiagnostics-color=never -o pr50251.s
GNU C (GCC) version 4.9.0 20131223 (experimental) [trunk revision 206176]
(cris-elf)
        compiled by GNU C version 4.4.4 20100630 (Red Hat 4.4.4-10), GMP
version 4.3.0, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C (GCC) version 4.9.0 20131223 (experimental) [trunk revision 206176]
(cris-elf)
        compiled by GNU C version 4.4.4 20100630 (Red Hat 4.4.4-10), GMP
version 4.3.0, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: cc4b37aa04284e09676146c2c3d35a20

Breakpoint 1, fancy_abort (file=0xd4f878 "/tmp/hpautotest-gcc1/gcc/gcc/expr.c",
line=3978, 
    function=0xd50d50 "fixup_args_size_notes") at
/tmp/hpautotest-gcc1/gcc/gcc/diagnostic.c:1182
1182    {
Missing separate debuginfos, use: debuginfo-install glibc-2.11.1-1.x86_64
libgcc-4.4.4-10.fc12.x86_64 libstdc++-4.4.4-10.fc12.x86_64
(gdb) up
#1  0x0000000000698222 in fixup_args_size_notes (prev=0x0, last=<value
optimized out>, 
    end_args_size=<value optimized out>) at
/tmp/hpautotest-gcc1/gcc/gcc/expr.c:3978
3978          gcc_assert (!saw_unknown);
(gdb) p prev
(gdb) p prev
$1 = (rtx_def *) 0x0
(gdb) p last
$2 = <value optimized out>
(gdb) up
#2  0x000000000067aefa in try_split (pat=<value optimized out>,
trial=0x7ffff7ea47e0, last=1)
    at /tmp/hpautotest-gcc1/gcc/gcc/emit-rtl.c:3602
3602              fixup_args_size_notes (NULL_RTX, insn_last, INTVAL (XEXP
(note, 0)));
(gdb) p insn_last
$3 = (rtx_def *) 0x7ffff7ea4c60
(gdb) p note
$4 = (rtx_def *) 0x7ffff7ea2df8
(gdb) pr
(expr_list:REG_ARGS_SIZE (const_int 0 [0])
    (nil))
(gdb) call debug_rtx_range ($3, 0)
(insn 34 33 0 (set (reg/f:SI 14 sp)
        (mem/f/c:SI (reg/f:SI 14 sp) [2 p+0 S4 A8])) -1
     (expr_list:REG_ARGS_SIZE (const_int 0 [0])
        (nil)))

(nil)

(gdb) bt
#0  fancy_abort (file=0xd4f878 "/tmp/hpautotest-gcc1/gcc/gcc/expr.c",
line=3978, 
    function=0xd50d50 "fixup_args_size_notes") at
/tmp/hpautotest-gcc1/gcc/gcc/diagnostic.c:1182
#1  0x0000000000698222 in fixup_args_size_notes (prev=0x0, last=<value
optimized out>, 
    end_args_size=<value optimized out>) at
/tmp/hpautotest-gcc1/gcc/gcc/expr.c:3978
#2  0x000000000067aefa in try_split (pat=<value optimized out>,
trial=0x7ffff7ea47e0, last=1)
    at /tmp/hpautotest-gcc1/gcc/gcc/emit-rtl.c:3602
#3  0x0000000000886e62 in split_insn (insn=0x7ffff7ea47e0) at
/tmp/hpautotest-gcc1/gcc/gcc/recog.c:2850
#4  0x0000000000887105 in split_all_insns () at
/tmp/hpautotest-gcc1/gcc/gcc/recog.c:2940
#5  0x00000000008871d3 in rest_of_handle_split_after_reload (this=<value
optimized out>)
    at /tmp/hpautotest-gcc1/gcc/gcc/recog.c:3889
#6  (anonymous namespace)::pass_split_after_reload::execute (this=<value
optimized out>)
    at /tmp/hpautotest-gcc1/gcc/gcc/recog.c:3918
#7  0x000000000086680a in execute_one_pass (pass=0x1171600) at
/tmp/hpautotest-gcc1/gcc/gcc/passes.c:2226
#8  0x0000000000866a86 in execute_pass_list (pass=0x1171600) at
/tmp/hpautotest-gcc1/gcc/gcc/passes.c:2279
#9  0x0000000000866a98 in execute_pass_list (pass=0x11714e0) at
/tmp/hpautotest-gcc1/gcc/gcc/passes.c:2280
#10 0x0000000000866a98 in execute_pass_list (pass=0x11703a0) at
/tmp/hpautotest-gcc1/gcc/gcc/passes.c:2280
#11 0x00000000005f3699 in expand_function (node=0x7ffff7eb5000) at
/tmp/hpautotest-gcc1/gcc/gcc/cgraphunit.c:1763
#12 0x00000000005f557d in expand_all_functions () at
/tmp/hpautotest-gcc1/gcc/gcc/cgraphunit.c:1897
#13 compile () at /tmp/hpautotest-gcc1/gcc/gcc/cgraphunit.c:2241
#14 0x00000000005f6c6a in finalize_compilation_unit () at
/tmp/hpautotest-gcc1/gcc/gcc/cgraphunit.c:2318
#15 0x00000000004a90f3 in c_write_global_declarations () at
/tmp/hpautotest-gcc1/gcc/gcc/c/c-decl.c:10400
#16 0x00000000008e560d in compile_file () at
/tmp/hpautotest-gcc1/gcc/gcc/toplev.c:561
#17 0x00000000008e6826 in do_compile (argc=15, argv=0x7fffffffe028) at
/tmp/hpautotest-gcc1/gcc/gcc/toplev.c:1887
#18 toplev_main (argc=15, argv=0x7fffffffe028) at
/tmp/hpautotest-gcc1/gcc/gcc/toplev.c:1963
#19 0x00000037d421eb1d in __libc_start_main () from /lib64/libc.so.6
#20 0x00000000004952c9 in _start ()
(gdb) up
#3  0x0000000000886e62 in split_insn (insn=0x7ffff7ea47e0) at
/tmp/hpautotest-gcc1/gcc/gcc/recog.c:2850
2850      rtx last = try_split (PATTERN (insn), insn, 1);
(gdb) p insn
$5 = (rtx_def *) 0x7ffff7ea47e0
(gdb) pr
(insn 14 13 32 2 (set (reg/f:SI 14 sp)
        (mem/f/c:SI (symbol_ref:SI ("p") <var_decl 0x7ffff7eb2000 p>) [2 p+0 S4
A8])) /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c:15 37
{*movsi_internal}
     (expr_list:REG_ARGS_SIZE (const_int 0 [0])
        (nil)))
(gdb) up
#4  0x0000000000887105 in split_all_insns () at
/tmp/hpautotest-gcc1/gcc/gcc/recog.c:2940
2940                      if (split_insn (insn))
(gdb) p insn
$6 = (rtx_def *) 0x7ffff7ea47e0
(failing sequence trying to call get_insns() omitted, instead using the
equivalent)
(gdb) call debug_rtx_range ((&x_rtl)->emit.x_first_insn, 0)
(note 1 0 3 NOTE_INSN_DELETED)

(note 3 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK)

(note 2 3 7 2 NOTE_INSN_FUNCTION_BEG)

(insn 7 2 8 2 (set (mem/f/c:SI (symbol_ref:SI ("p") <var_decl 0x7ffff7eb2000
p>) [2 p+0 S4 A8])
        (reg/f:SI 14 sp))
/tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c:13 37 {*movsi_internal}
     (nil))

(note 8 7 9 2 NOTE_INSN_DELETED)

(insn 9 8 31 2 (set (reg/f:SI 0 r0 [31])
        (symbol_ref:SI ("bar") [flags 0x41] <function_decl 0x7ffff7ea1a00
bar>)) /tmp/hpautotest-gcc1/gcc/gcc/testsuite/
gcc.dg/pr50251.c:14 37 {*movsi_internal}
     (expr_list:REG_EQUIV (symbol_ref:SI ("bar") [flags 0x41] <function_decl
0x7ffff7ea1a00 bar>)
        (nil)))

(insn 31 9 10 2 (set (reg:SI 10 r10)
        (const_int -4 [0xfffffffffffffffc]))
/tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c:14 37 {*movsi_internal}
     (nil))

(insn 10 31 11 2 (set (reg:SI 10 r10)
        (plus:SI (reg:SI 10 r10)
            (reg/f:SI 8 r8)))
/tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c:14 74 {*addsi3_non_v32}
     (expr_list:REG_EQUAL (plus:SI (reg/f:SI 8 r8)
            (const_int -4 [0xfffffffffffffffc]))
        (nil)))

(call_insn 11 10 12 2 (parallel [
            (call (mem:QI (reg/f:SI 0 r0 [31]) [0 bar S1 A8])
                (const_int 0 [0]))
            (clobber (reg:SI 16 srp))
        ]) /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c:14 220
{*expanded_call_non_v32}
     (nil)
    (expr_list:REG_UNUSED (use (reg:SI 10 r10))
        (nil)))

(insn 12 11 13 2 (clobber (mem:BLK (scratch) [0  A8]))
/tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c:15 -1
     (nil))

(insn 13 12 14 2 (clobber (mem:BLK (reg/f:SI 14 sp) [0  A8]))
/tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c:15 -1
     (nil))

(insn 14 13 32 2 (set (reg/f:SI 14 sp)
        (mem/f/c:SI (symbol_ref:SI ("p") <var_decl 0x7ffff7eb2000 p>) [2 p+0 S4
A8])) /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c:15 37
{*movsi_internal}
     (expr_list:REG_ARGS_SIZE (const_int 0 [0])
        (nil)))

(insn 32 14 17 2 (set (reg:SI 10 r10)
        (const_int -4 [0xfffffffffffffffc]))
/tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c:16 37 {*movsi_internal}
     (nil))

(insn 17 32 18 2 (set (reg:SI 10 r10)
        (plus:SI (reg:SI 10 r10)
            (reg/f:SI 8 r8)))
/tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c:16 74 {*addsi3_non_v32}
     (expr_list:REG_EQUAL (plus:SI (reg/f:SI 8 r8)
            (const_int -4 [0xfffffffffffffffc]))
        (nil)))

(call_insn 18 17 23 2 (parallel [
            (call (mem:QI (reg/f:SI 0 r0 [31]) [0 bar S1 A8])
                (const_int 0 [0]))
            (clobber (reg:SI 16 srp))
        ]) /tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c:16 220
{*expanded_call_non_v32}
     (nil)
    (expr_list:REG_UNUSED (use (reg:SI 10 r10))
        (nil)))

(insn 23 18 26 2 (set (reg/i:SI 10 r10)
        (const_int 0 [0]))
/tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c:18 37 {*movsi_internal}
     (nil))

(insn 26 23 29 2 (use (reg/i:SI 10 r10))
/tmp/hpautotest-gcc1/gcc/gcc/testsuite/gcc.dg/pr50251.c:18 -1
     (nil))

(note 29 26 0 NOTE_INSN_DELETED)

(nil) 

(gdb) 


Author of (all) suspect commits in revision range CC:ed.



More information about the Gcc-bugs mailing list