diff options
author | Richard Biener <rguenther@suse.de> | 2023-02-20 09:54:37 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2023-02-20 09:54:37 +0100 |
commit | ae113080a9f98e807db239f3ad2157c64324542f (patch) | |
tree | a406e30e1f07d830c46566e146fabd2f1c5f39cd /gcc/tree-ssa-loop-manip.cc | |
parent | ca31bc3366c533a55bfd7f1b9f4959c0c9869a7b (diff) | |
download | gcc-ae113080a9f98e807db239f3ad2157c64324542f.zip gcc-ae113080a9f98e807db239f3ad2157c64324542f.tar.gz gcc-ae113080a9f98e807db239f3ad2157c64324542f.tar.bz2 |
tree-optimization/108825 - checking ICE with unroll-and-jam
The issue is that unroll-and-jam applies RPO VN on the transformed body but
that leaves the IL in "indetermined" state (it returns a TODO to make it
valid again). But unroll-and-jam then continues to transform another loop and
in using the tree_unroll_loop helper runs into tree_transform_and_unroll_loop
performing IL checking on the whole function.
While the real fix is to elide all such checking I'm only making the
loop-local LC SSA verifier not perform function-wide SSA verification
at this point.
PR tree-optimization/108825
* tree-ssa-loop-manip.cc (verify_loop_closed_ssa): For
loop-local verfication only verify there's no pending SSA
update.
* gcc.dg/torture/pr108825.c: New testcase.
Diffstat (limited to 'gcc/tree-ssa-loop-manip.cc')
-rw-r--r-- | gcc/tree-ssa-loop-manip.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/tree-ssa-loop-manip.cc b/gcc/tree-ssa-loop-manip.cc index 14fe65f..09acc1c 100644 --- a/gcc/tree-ssa-loop-manip.cc +++ b/gcc/tree-ssa-loop-manip.cc @@ -681,15 +681,15 @@ verify_loop_closed_ssa (bool verify_ssa_p, class loop *loop) if (number_of_loops (cfun) <= 1) return; - if (verify_ssa_p) - verify_ssa (false, true); - timevar_push (TV_VERIFY_LOOP_CLOSED); if (loop == NULL) { basic_block bb; + if (verify_ssa_p) + verify_ssa (false, true); + FOR_EACH_BB_FN (bb, cfun) if (bb->loop_father && bb->loop_father->num > 0) check_loop_closed_ssa_bb (bb); @@ -698,6 +698,11 @@ verify_loop_closed_ssa (bool verify_ssa_p, class loop *loop) { basic_block *bbs = get_loop_body (loop); + /* We do not have loop-local SSA verification so just + check there's no update queued. */ + if (verify_ssa_p) + gcc_assert (!need_ssa_update_p (cfun)); + for (unsigned i = 0; i < loop->num_nodes; ++i) check_loop_closed_ssa_bb (bbs[i]); |