diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-02-26 16:11:04 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-02-26 16:11:04 -0500 |
commit | 9ff08f70f3b2ab1b68c1e7934ede369ae0417c4f (patch) | |
tree | 0ccec64eeb183beb37bb7eca2b541f679aa57043 | |
parent | 766f36c7cf7003b953eccfd91ec09c26a27cc49a (diff) | |
download | gcc-9ff08f70f3b2ab1b68c1e7934ede369ae0417c4f.zip gcc-9ff08f70f3b2ab1b68c1e7934ede369ae0417c4f.tar.gz gcc-9ff08f70f3b2ab1b68c1e7934ede369ae0417c4f.tar.bz2 |
(count_reg_usage, case SET): If SRC has side-effects, count a usage of
DEST in it.
From-SVN: r6631
-rw-r--r-- | gcc/cse.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -8338,7 +8338,16 @@ count_reg_usage (x, counts, dest, incr) /* Unless we are setting a REG, count everything in SET_DEST. */ if (GET_CODE (SET_DEST (x)) != REG) count_reg_usage (SET_DEST (x), counts, NULL_RTX, incr); - count_reg_usage (SET_SRC (x), counts, SET_DEST (x), incr); + + /* If SRC has side-effects, then we can't delete this insn, so the + usage of SET_DEST inside SRC counts. + + ??? Strictly-speaking, we might be preserving this insn + because some other SET has side-effects, but that's hard + to do and can't happen now. */ + count_reg_usage (SET_SRC (x), counts, + side_effects_p (SET_SRC (x)) ? NULL_RTX : SET_DEST (x), + incr); return; case INSN: |