From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16488 invoked by alias); 13 Jan 2010 23:27:56 -0000 Received: (qmail 16062 invoked by uid 48); 13 Jan 2010 23:27:37 -0000 Date: Wed, 13 Jan 2010 23:27:00 -0000 Message-ID: <20100113232737.16061.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug rtl-optimization/42691] problematic REG_EQUAL note added to SUBREG In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ebotcazou at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-01/txt/msg01605.txt.bz2 ------- Comment #10 from ebotcazou at gcc dot gnu dot org 2010-01-13 23:27 ------- > Otherwise, I would simply remove this comment. Fine with me, it's indeed a little confusing. > I does hunk #3, because I am not sure if all combination results from > case2 would pass "recog_for_combine". If any case fail, gcc may try > other combination patterns, where I am afraid changed_i3_dest=1 may > cause problem. I haven't read the code after validate_replacement > label thoroughly. To be conservative, I use hunk#3 to guarantee that > if the combination result from case2 is not recognized, nothing has > been changed. gcc is free to go ahead and try other combination > patterns. This is conservative. If anyone confirms that the cases that > I concern of will never happen, I am happy to remove hunk#3. Can you > confirm? Yes, jumping to validate_replacement means that the other combinations are not tried. If the new pattern is not valid, the code will try to massage it and not try other combinations. And I think that, in practice, it won't actually do anything since the various subsequent tricks are incompatible with case2. > Index: combine.c > =================================================================== > --- combine.c (revision 155801) > +++ combine.c (working copy) > @@ -2663,10 +2663,17 @@ try_combine (rtx i3, rtx i2, rtx i1, int > i2dest = SET_DEST (temp); > i2dest_killed = dead_or_set_p (i2, i2dest); > > + /* Replace the source in I2 with our dest and make the resulting > + insn the new pattern for I3. Then skip to where we > + validate the pattern. Everything was set up above. */ "Replace the source in I2 with the new constant and..." > SUBST (SET_SRC (temp), > immed_double_const (olo, ohi, GET_MODE (SET_DEST (temp)))); > > newpat = PATTERN (i2); > + > + /* If the result of combination is recognized, the note of I3 needs > + * to be removed. */ > + changed_i3_dest = 1; No need to invoke the consequences, just state the cause: "The dest of I3 has been replaced with the dest of I2." -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42691