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

             Bug #: 51495
           Summary: [4.7 Regression] ICE: in
                    force_nonfallthru_and_redirect, at cfgrtl.c:1171 with
                    computed goto
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: zso...@seznam.cz
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu


Created attachment 26041
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26041
reduced testcase

Compiler output:
$ gcc -O testcase.c
testcase.c: In function 'foo':
testcase.c:14:1: internal compiler error: in force_nonfallthru_and_redirect, at
cfgrtl.c:1171
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

(gdb) list
1166          /* Irritating special case - fallthru edge to the same block as
abnormal
1167             edge.
1168             We can't redirect abnormal edge, but we still can split the
fallthru
1169             one and create separate abnormal edge to original destination.
1170             This allows bb-reorder to make such edge non-fallthru.  */
1171          gcc_assert (e->dest == target);
1172          abnormal_edge_flags = e->flags & ~(EDGE_FALLTHRU |
EDGE_CAN_FALLTHRU);
1173          e->flags &= EDGE_FALLTHRU | EDGE_CAN_FALLTHRU;
1174        }
1175      else
(gdb) bt
#0  fancy_abort (file=0x1242d48 "/mnt/svn/gcc-trunk/gcc/cfgrtl.c", line=1171,
function=0x1243aa0 "force_nonfallthru_and_redirect")
    at /mnt/svn/gcc-trunk/gcc/diagnostic.c:898
#1  0x000000000069e7e8 in force_nonfallthru_and_redirect (e=0x7ffff5691540,
target=0x7ffff5670618, jump_label=0x0)
    at /mnt/svn/gcc-trunk/gcc/cfgrtl.c:1171
#2  0x0000000000689962 in redirect_edge_and_branch_force (e=0x7ffff5691540,
dest=0x7ffff5670618) at /mnt/svn/gcc-trunk/gcc/cfghooks.c:399
#3  0x00000000007f9867 in dup_block_and_redirect () at
/mnt/svn/gcc-trunk/gcc/function.c:5551
#4  thread_prologue_and_epilogue_insns () at
/mnt/svn/gcc-trunk/gcc/function.c:6126
#5  0x00000000007f9f05 in rest_of_handle_thread_prologue_and_epilogue () at
/mnt/svn/gcc-trunk/gcc/function.c:6792
#6  0x00000000008f8925 in execute_one_pass (pass=0x17be260) at
/mnt/svn/gcc-trunk/gcc/passes.c:2079
#7  0x00000000008f8cc5 in execute_pass_list (pass=0x17be260) at
/mnt/svn/gcc-trunk/gcc/passes.c:2134
#8  0x00000000008f8cd7 in execute_pass_list (pass=0x17bee80) at
/mnt/svn/gcc-trunk/gcc/passes.c:2135
#9  0x00000000008f8cd7 in execute_pass_list (pass=0x17beee0) at
/mnt/svn/gcc-trunk/gcc/passes.c:2135
#10 0x0000000000a5a46e in tree_rest_of_compilation (fndecl=0x7ffff5672c00) at
/mnt/svn/gcc-trunk/gcc/tree-optimize.c:421
#11 0x00000000006ad84a in cgraph_expand_function (node=0x7ffff55636c0) at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1818
#12 0x00000000006af5ec in cgraph_expand_all_functions () at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1885
#13 cgraph_optimize () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:2198
#14 0x00000000006afd5a in cgraph_finalize_compilation_unit () at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1327
#15 0x000000000058d620 in c_write_global_declarations () at
/mnt/svn/gcc-trunk/gcc/c-decl.c:10026
#16 0x00000000009edaf4 in compile_file (argc=13, argv=0x7fffffffdb18) at
/mnt/svn/gcc-trunk/gcc/toplev.c:573
#17 do_compile (argc=13, argv=0x7fffffffdb18) at
/mnt/svn/gcc-trunk/gcc/toplev.c:1928
#18 toplev_main (argc=13, argv=0x7fffffffdb18) at
/mnt/svn/gcc-trunk/gcc/toplev.c:2004
#19 0x00007ffff61570ed in __libc_start_main () from /lib64/libc.so.6
#20 0x0000000000570df1 in _start ()

Tested revisions:
r182183 - crash
r181710 - crash
r180540 - OK

Reply via email to