aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPan Li <pan2.li@intel.com>2024-06-11 21:39:43 +0800
committerPan Li <pan2.li@intel.com>2024-06-12 14:50:29 +0800
commitacd2ca1e28128d9d0d41683d6039f437c02d793f (patch)
tree395d06507bf7586b0396b91bf88c9137788a8801
parent919e88f7915b57ae3a2152a1947dbfac3fccfe88 (diff)
downloadgcc-acd2ca1e28128d9d0d41683d6039f437c02d793f.zip
gcc-acd2ca1e28128d9d0d41683d6039f437c02d793f.tar.gz
gcc-acd2ca1e28128d9d0d41683d6039f437c02d793f.tar.bz2
Widening-Mul: Take gsi after_labels instead of start_bb for gcall insertion
We inserted the gcall of .SAT_ADD before the gsi_start_bb for avoiding the ssa def after use ICE issue. Unfortunately, there will be the potential ICE when the first stmt is label. We cannot insert the gcall before the label. Thus, we take gsi_after_labels to locate the 'really' stmt that the gcall will insert before. The existing test cases pr115387-1.c and pr115387-2.c cover this change. The below test suites are passed for this patch. * The rv64gcv fully regression test with newlib. * The x86 regression test. * The x86 bootstrap test. gcc/ChangeLog: * tree-ssa-math-opts.cc (math_opts_dom_walker::after_dom_children): Leverage gsi_after_labels instead of gsi_start_bb to skip the leading labels of bb. Signed-off-by: Pan Li <pan2.li@intel.com>
-rw-r--r--gcc/tree-ssa-math-opts.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc
index fbb8e0e..c09e900 100644
--- a/gcc/tree-ssa-math-opts.cc
+++ b/gcc/tree-ssa-math-opts.cc
@@ -6102,7 +6102,7 @@ math_opts_dom_walker::after_dom_children (basic_block bb)
for (gphi_iterator psi = gsi_start_phis (bb); !gsi_end_p (psi);
gsi_next (&psi))
{
- gimple_stmt_iterator gsi = gsi_start_bb (bb);
+ gimple_stmt_iterator gsi = gsi_after_labels (bb);
match_unsigned_saturation_add (&gsi, psi.phi ());
}