[Bug tree-optimization/54900] write introduction incorrect wrt the C11 memory model (2)
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Oct 11 11:59:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54900
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |aldyh at gcc dot gnu.org,
| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-11 11:59:14 UTC ---
This is ifcvt.c in action.
This is the if (!set_b && MEM_P (orig_x)) case where we already do some checks:
if (noce_mem_write_may_trap_or_fault_p (orig_x)) return FALSE; and
if (!noce_can_store_speculate_p (test_bb, orig_x)) return FALSE;
I'd say noce_can_store_speculate_p is buggy, it uses
if (memory_modified_in_insn_p (mem, insn))
return true;
but memory_modified_in_insn_p is pessimistic, it doesn't tell whether mem is
surely set, but whether it might be set. I guess it would need to use
note_stores that would just do rtx_equal_p on the addresses or similarly prove
it is surely (and unconditionally) written. So even note_stores might not be
the right thing, perhaps just looking at single_set SET_DEST. And avoiding
inline asm, that doesn't have to store unconditionally.
More information about the Gcc-bugs
mailing list