diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-03-01 22:31:52 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-03-01 22:31:52 +0000 |
commit | 066c8e94378ff486ba956acf609a8af246f45de6 (patch) | |
tree | ce9623d9e599375c8a302640e503ebd518fd6185 /gcc/gcse.c | |
parent | d3b819add225171c856bc64f9a15da90cf4976b7 (diff) | |
download | gcc-066c8e94378ff486ba956acf609a8af246f45de6.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233867 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r-- | gcc/gcse.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c index 51277a1cb61..a3a7dc31353 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -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); + } } } } |