https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118521
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org --- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Richard Biener from comment #9) [...] > diff --git a/gcc/passes.def b/gcc/passes.def > index 9fd85a35a63..c02fd0e186d 100644 > --- a/gcc/passes.def > +++ b/gcc/passes.def > @@ -346,9 +346,10 @@ along with GCC; see the file COPYING3. If not see > form if possible. */ > NEXT_PASS (pass_thread_jumps, /*first=*/false); > NEXT_PASS (pass_dominator, false /* may_peel_loop_headers_p */); > - NEXT_PASS (pass_strlen); > NEXT_PASS (pass_thread_jumps_full, /*first=*/false); > NEXT_PASS (pass_vrp, true /* final_p */); > + NEXT_PASS (pass_forwprop, /*last=*/true); > + NEXT_PASS (pass_strlen); > /* Run CCP to compute alignment and nonzero bits. */ > NEXT_PASS (pass_ccp, true /* nonzero_p */); > NEXT_PASS (pass_warn_restrict); > @@ -356,7 +357,6 @@ along with GCC; see the file COPYING3. If not see > NEXT_PASS (pass_dce, true /* update_address_taken_p */, true /* > remove_unused_locals */); > /* After late DCE we rewrite no longer addressed locals into SSA > form if possible. */ > - NEXT_PASS (pass_forwprop, /*last=*/true); > NEXT_PASS (pass_sink_code, true /* unsplit edges */); > NEXT_PASS (pass_phiopt, false /* early_p */); > NEXT_PASS (pass_fold_builtins); > Causes +FAIL: c-c++-common/Wstringop-overflow.c -std=gnu++17 (test for warnings, line 93) +FAIL: c-c++-common/Wstringop-overflow.c -std=gnu++17 (test for warnings, line 94) ... +FAIL: gcc.dg/strlenopt-3.c scan-tree-dump-times optimized "return 0" 3 +FAIL: gcc.dg/strlenopt-45.c (test for excess errors) +FAIL: gcc.dg/strlenopt-45.c scan-tree-dump-times optimized "call_in_true_branch_not_eliminated_" 0 +FAIL: gcc.dg/strlenopt-70.c scan-tree-dump-times optimized "_not_eliminated_" 0 +FAIL: gcc.dg/strlenopt-70.c scan-tree-dump-times optimized "strlen" 0 +FAIL: gcc.dg/strlenopt-73.c scan-tree-dump-times optimized "_not_eliminated_" 0 +FAIL: gcc.dg/strlenopt-73.c scan-tree-dump-times optimized "strlen" 0 +FAIL: gcc.dg/strlenopt-77.c scan-tree-dump-times optimized "call_in_true_branch_not_eliminated_" 0 +FAIL: gcc.dg/strlenopt-80.c (test for excess errors) +FAIL: gcc.dg/strlenopt-80.c scan-tree-dump-times optimized "failure_on_line \\\\(" 0 +FAIL: gcc.dg/strlenopt-91.c scan-tree-dump-not optimized "abort" +FAIL: gcc.dg/tree-ssa/builtin-snprintf-3.c scan-tree-dump-not optimized "failure_range" +FAIL: gcc.dg/tree-ssa/builtin-snprintf-7.c scan-tree-dump-times optimized "_not_eliminated" 0 +FAIL: gcc.dg/tree-ssa/builtin-snprintf-8.c scan-tree-dump-not optimized "abort" +FAIL: gcc.dg/tree-ssa/builtin-snprintf-9.c scan-tree-dump-not optimized "abort" +FAIL: gcc.dg/tree-ssa/builtin-sprintf-4.c scan-tree-dump-not optimized "failure_on_line" +FAIL: gcc.dg/tree-ssa/builtin-sprintf-9.c scan-tree-dump-times optimized "call_in_true_branch_not_eliminated_" 0 +FAIL: gcc.dg/tree-ssa/builtin-sprintf.c (test for excess errors) +UNRESOLVED: gcc.dg/tree-ssa/builtin-sprintf.c compilation failed to produce executable +FAIL: gcc.dg/tree-ssa/pr79327-2.c scan-tree-dump-not optimized "failure_on_line" +FAIL: gcc.dg/tree-ssa/pr83198.c scan-tree-dump-not optimized "link_error \\\\(\\\\);" > diff --git a/gcc/tree-scalar-evolution.cc b/gcc/tree-scalar-evolution.cc > index 0ba85917d41..a0d1c2f3d86 100644 > --- a/gcc/tree-scalar-evolution.cc > +++ b/gcc/tree-scalar-evolution.cc > @@ -284,6 +284,7 @@ along with GCC; see the file COPYING3. If not see > #include "tree-into-ssa.h" > #include "builtins.h" > #include "case-cfn-macros.h" > +#include "tree-eh.h" > > static tree analyze_scalar_evolution_1 (class loop *, tree); > static tree analyze_scalar_evolution_for_address_of (class loop *loop, > @@ -3947,6 +3948,19 @@ final_value_replacement_loop (class loop *loop) > print_gimple_stmt (dump_file, SSA_NAME_DEF_STMT (rslt), 0); > fprintf (dump_file, "\n"); > } > + > + if (! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rslt)) > + { > + gimple *use_stmt; > + imm_use_iterator imm_iter; > + FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, rslt) > + { > + gimple_stmt_iterator gsi = gsi_for_stmt (use_stmt); > + if (!stmt_can_throw_internal (cfun, use_stmt) > + && fold_stmt (&gsi, follow_all_ssa_edges)) > + update_stmt (gsi_stmt (gsi)); > + } > + } > } > > return any; > > this should have the least chance of regressing things. I'll report results. This OTOH works fine, so posted for review.