This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/54900] write introduction incorrect wrt the C11 memory model (2)
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 11 Oct 2012 11:59:14 +0000
- Subject: [Bug tree-optimization/54900] write introduction incorrect wrt the C11 memory model (2)
- Auto-submitted: auto-generated
- References: <bug-54900-4@http.gcc.gnu.org/bugzilla/>
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.