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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
VN redundant store removal gets up to

      tree val = NULL_TREE;
      if (lookup_lhs)
        val = vn_reference_lookup (lookup_lhs, gimple_vuse (stmt),
                                   VN_WALKREWRITE, &vnresult, false,
                                   NULL, NULL_TREE, true);
      if (TREE_CODE (rhs) == SSA_NAME)
        rhs = VN_INFO (rhs)->valnum;
      if (val
          && (operand_equal_p (val, rhs, 0)
              /* Due to the bitfield lookups above we can get bit
                 interpretations of the same RHS as values here.  Those
                 are redundant as well.  */
              || (TREE_CODE (val) == SSA_NAME
                  && gimple_assign_single_p (SSA_NAME_DEF_STMT (val))
                  && (val = gimple_assign_rhs1 (SSA_NAME_DEF_STMT (val)))
                  && TREE_CODE (val) == VIEW_CONVERT_EXPR
                  && TREE_OPERAND (val, 0) == rhs)))

here.  Not allowing for CONVERT_EXPR_CODE_P that is a noop-conversion
(with -fno-strict-aliasing pointer vs. int might also be OK).

I have a patch.

Reply via email to