From 9ff08f70f3b2ab1b68c1e7934ede369ae0417c4f Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Sat, 26 Feb 1994 16:11:04 -0500 Subject: [PATCH] (count_reg_usage, case SET): If SRC has side-effects, count a usage of DEST in it. From-SVN: r6631 --- gcc/cse.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/cse.c b/gcc/cse.c index 81263b74556..b0294782c0a 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -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: -- 2.30.2