From 1230f784cfacdc877d711e335fdded154263b5fb Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Mon, 26 Jan 2015 23:07:54 -0500 Subject: [PATCH] rl78.c (move_elim_pass): Don't optimize away volatile memory references. * config/rl78/rl78.c (move_elim_pass): Don't optimize away volatile memory references. From-SVN: r220151 --- gcc/ChangeLog | 5 +++++ gcc/config/rl78/rl78.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e44eb7360af..5add60716b0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-01-26 DJ Delorie + + * config/rl78/rl78.c (move_elim_pass): Don't optimize away + volatile memory references. + 2015-01-26 Oleg Endo PR target/49263 diff --git a/gcc/config/rl78/rl78.c b/gcc/config/rl78/rl78.c index ebb25dd5c4e..a6d97cd7021 100644 --- a/gcc/config/rl78/rl78.c +++ b/gcc/config/rl78/rl78.c @@ -222,7 +222,12 @@ move_elim_pass (void) can eliminate the second SET. */ if (prev && rtx_equal_p (SET_DEST (prev), SET_SRC (set)) - && rtx_equal_p (SET_DEST (set), SET_SRC (prev))) + && rtx_equal_p (SET_DEST (set), SET_SRC (prev)) + /* ... and none of the operands are volatile. */ + && ! volatile_refs_p (SET_SRC (prev)) + && ! volatile_refs_p (SET_DEST (prev)) + && ! volatile_refs_p (SET_SRC (set)) + && ! volatile_refs_p (SET_DEST (set))) { if (dump_file) fprintf (dump_file, " Delete insn %d because it is redundant\n", -- 2.30.2