https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71643
Bug ID: 71643 Summary: [7 Regression] internal compiler error: in redirect_eh_edge_1, at tree-eh.c:2318 after r237427 Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: jgreenhalgh at gcc dot gnu.org CC: jakub at gcc dot gnu.org, jakub at redhat dot com Target Milestone: --- Created attachment 38755 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38755&action=edit Reduced testcase After r237427: PR tree-optimization/71520 * tree-ssa-tail-merge.c (find_duplicate): Handle labels. (replace_block_by): Move user labels from bb1 to bb2. * gcc.dg/tree-ssa/pr71520.c: New test. I'm seeing the following ICE for the attached reduced testcase when compiling with -O3 on aarch64-none-linux-gnu/x86_64-unknown-linux-gnu: x.cpp:30:1: internal compiler error: in redirect_eh_edge_1, at tree-eh.c:2318 foo (void) ^~~ 0xd2d737 redirect_eh_edge_1 .../gcc/tree-eh.c:2318 0xd2d8e7 redirect_eh_edge(edge_def*, basic_block_def*) .../gcc/tree-eh.c:2370 0xd12d5e gimple_redirect_edge_and_branch .../gcc/tree-cfg.c:5664 0x8d2976 redirect_edge_and_branch(edge_def*, basic_block_def*) .../gcc/cfghooks.c:356 0xec9098 replace_block_by .../gcc/tree-ssa-tail-merge.c:1538 0xec9098 apply_clusters .../gcc/tree-ssa-tail-merge.c:1635 0xec9098 tail_merge_optimize(unsigned int) .../gcc/tree-ssa-tail-merge.c:1743 0xe78871 execute .../gcc/tree-ssa-pre.c:4826 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.