[Bug rtl-optimization/62030] wrong code due to ifcvt merging two stores which have different aliasing sets

vries at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Aug 6 06:58:00 GMT 2014


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

vries at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vries at gcc dot gnu.org

--- Comment #2 from vries at gcc dot gnu.org ---
I think the test-case is reading an undefined value from n->next, but that's
easy enough to fix with an intializer for node.

Taking the tentative patch from PR62004, (
https://gcc.gnu.org/bugzilla/attachment.cgi?id=33242&action=diff ), with this
patch added prevents the if-conversion in this case:
...
@@ -2504,7 +2534,9 @@ noce_process_if_block (struct noce_if_info *if_info)
       if (! insn_b
      || insn_b != last_active_insn (else_bb, FALSE)
      || (set_b = single_set (insn_b)) == NULL_RTX
-         || ! rtx_equal_p (x, SET_DEST (set_b)))
+         || ! (rtx_equal_p (x, SET_DEST (set_b))
+               && (GET_CODE (x) != MEM
+                   || mem_interchangeable_p (x, SET_DEST (set_b))))
    return FALSE;
     }
   else
...



More information about the Gcc-bugs mailing list