https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106883

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
diff --git a/gcc/gimple-ssa-strength-reduction.cc
b/gcc/gimple-ssa-strength-reduction.cc
index 55ee0ca33e4..6c85480364c 100644
--- a/gcc/gimple-ssa-strength-reduction.cc
+++ b/gcc/gimple-ssa-strength-reduction.cc
@@ -1758,7 +1758,8 @@ find_candidates_dom_walker::before_dom_children
(basic_block bb)
        slsr_process_ref (gs);

       else if (is_gimple_assign (gs)
-              && (INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_lhs (gs)))
+              && ((INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_lhs (gs)))
+                   && TYPE_OVERFLOW_WRAPS (TREE_TYPE (gimple_assign_lhs
(gs))))
                   || POINTER_TYPE_P (TREE_TYPE (gimple_assign_lhs (gs)))))
        {
          tree rhs1 = NULL_TREE, rhs2 = NULL_TREE;

causes almost all slsr testcases (gcc.dg/tree-ssa/slsr-*.c) to FAIL as they
are written with signed arithmetic.

Reply via email to