diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2016-03-01 22:31:52 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2016-03-01 22:31:52 +0000 |
commit | 0bca04b822bc5ee0f5bbb2ba5df6669a433d0bf5 (patch) | |
tree | ce9623d9e599375c8a302640e503ebd518fd6185 /gcc/gcse.c | |
parent | 2a9afc868088221a4edd54e79d1388ab25f7f2fa (diff) | |
download | gcc-0bca04b822bc5ee0f5bbb2ba5df6669a433d0bf5.zip gcc-0bca04b822bc5ee0f5bbb2ba5df6669a433d0bf5.tar.gz gcc-0bca04b822bc5ee0f5bbb2ba5df6669a433d0bf5.tar.bz2 |
re PR rtl-optimization/70007 (wrong code with -mbmi2)
PR rtl-optimization/70007
* gcse.c (compute_ld_motion_mems): Tidy up and also invalidate memory
references present in REG_EQUAL notes attached to non-SET patterns.
From-SVN: r233867
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r-- | gcc/gcse.c | 27 |
1 files changed, 17 insertions, 10 deletions
@@ -3796,10 +3796,8 @@ compute_ld_motion_mems (void) { rtx src = SET_SRC (PATTERN (insn)); rtx dest = SET_DEST (PATTERN (insn)); - rtx note = find_reg_equal_equiv_note (insn); - rtx src_eq; - /* Check for a simple LOAD... */ + /* Check for a simple load. */ if (MEM_P (src) && simple_mem (src)) { ptr = ldst_entry (src); @@ -3814,12 +3812,11 @@ compute_ld_motion_mems (void) invalidate_any_buried_refs (src); } - if (note != 0 && REG_NOTE_KIND (note) == REG_EQUAL) - src_eq = XEXP (note, 0); - else - src_eq = NULL_RTX; - - if (src_eq != NULL_RTX + /* Check for a simple load through a REG_EQUAL note. */ + rtx note = find_reg_equal_equiv_note (insn), src_eq; + if (note + && REG_NOTE_KIND (note) == REG_EQUAL + && (src_eq = XEXP (note, 0)) && !(MEM_P (src_eq) && simple_mem (src_eq))) invalidate_any_buried_refs (src_eq); @@ -3843,7 +3840,17 @@ compute_ld_motion_mems (void) } } else - invalidate_any_buried_refs (PATTERN (insn)); + { + /* Invalidate all MEMs in the pattern and... */ + invalidate_any_buried_refs (PATTERN (insn)); + + /* ...in REG_EQUAL notes for PARALLELs with single SET. */ + rtx note = find_reg_equal_equiv_note (insn), src_eq; + if (note + && REG_NOTE_KIND (note) == REG_EQUAL + && (src_eq = XEXP (note, 0))) + invalidate_any_buried_refs (src_eq); + } } } } |