From: DJ Delorie Date: Tue, 27 Jan 2015 04:07:54 +0000 (-0500) Subject: rl78.c (move_elim_pass): Don't optimize away volatile memory references. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1230f784cfacdc877d711e335fdded154263b5fb;p=gcc.git 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 --- 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",