From: Andrew MacLeod Date: Thu, 30 May 2024 13:40:46 +0000 (-0400) Subject: scev query mismatch message X-Git-Tag: basepoints/gcc-16~8374 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2f0c09c00b8ccf41c27d4b7ba0cafdeb99242a29;p=thirdparty%2Fgcc.git scev query mismatch message Add a message to the listing if SCEV is not invoked because of a range_query mismatch * gimple-range-fold.cc (range_of_ssa_name_with_loop_info): Issue a message if SCEV is not invoked due to a mismatch. --- diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc index 98a4877ba18..6037c29ce11 100644 --- a/gcc/gimple-range-fold.cc +++ b/gcc/gimple-range-fold.cc @@ -1267,9 +1267,18 @@ fold_using_range::range_of_ssa_name_with_loop_info (vrange &r, tree name, // SCEV currently invokes get_range_query () for values. If the query // being passed in is not the same SCEV will use, do not invoke SCEV. // This can be remove if/when SCEV uses a passed in range-query. - if (src.query () != get_range_query (cfun) - || !range_of_var_in_loop (r, name, l, phi, src.query ())) - r.set_varying (TREE_TYPE (name)); + if (src.query () != get_range_query (cfun)) + { + r.set_varying (TREE_TYPE (name)); + // Report the msmatch if SRC is not the global query. The cache + // uses a global query and would provide numerous false positives. + if (dump_file && (dump_flags & TDF_DETAILS) + && src.query () != get_global_range_query ()) + fprintf (dump_file, + "fold_using-range:: SCEV not invoked due to mismatched queries\n"); + } + else if (!range_of_var_in_loop (r, name, l, phi, src.query ())) + r.set_varying (TREE_TYPE (name)); } // -----------------------------------------------------------------------