Message ID | 20221129115910.9268213428@imap2.suse-dmz.suse.de |
---|---|
State | New |
Headers | show |
Series | tree-optimization/106995 - if-conversion and vanishing loops | expand |
diff --git a/gcc/tree-if-conv.cc b/gcc/tree-if-conv.cc index 34bb507ff3b..64b20b4a9e1 100644 --- a/gcc/tree-if-conv.cc +++ b/gcc/tree-if-conv.cc @@ -3761,7 +3761,8 @@ pass_if_conversion::execute (function *fun) if (!gimple_bb (g)) continue; unsigned ifcvt_loop = tree_to_uhwi (gimple_call_arg (g, 0)); - if (!get_loop (fun, ifcvt_loop)) + unsigned orig_loop = tree_to_uhwi (gimple_call_arg (g, 1)); + if (!get_loop (fun, ifcvt_loop) || !get_loop (fun, orig_loop)) { if (dump_file) fprintf (dump_file, "If-converted loop vanished\n");