On Tue, Apr 25, 2017 at 09:31:00PM +0200, Jakub Jelinek wrote: > This patch let us search for x's setter earlier in the bb. > During testing I found that modified_in_p/modified_in_between_p don't > actually take into account calls that could change MEMs, so the patch > handles that too.
Or shall we just: --- gcc/alias.c 2017-04-25 15:51:31.072923325 +0200 +++ gcc/alias.c 2017-04-26 13:23:55.595048464 +0200 @@ -3221,6 +3221,8 @@ memory_modified_in_insn_p (const_rtx mem { if (!INSN_P (insn)) return false; + if (CALL_P (insn)) + return true; memory_modified = false; note_stores (PATTERN (insn), memory_modified_1, CONST_CAST_RTX(mem)); return memory_modified; instead of the call_crossed hacks? Then modified_between_p and modified_in_p would return true for !MEM_READONLY_P MEMs crossing a call. Jakub