From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18648 invoked by alias); 13 Jan 2010 10:03:33 -0000 Received: (qmail 16678 invoked by uid 48); 13 Jan 2010 10:03:20 -0000 Date: Wed, 13 Jan 2010 10:03:00 -0000 Message-ID: <20100113100320.16674.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/msg01455.txt.bz2 ------- Comment #7 from ebotcazou at gcc dot gnu dot org 2010-01-13 10:03 ------- > This patch fixes the bug. > Do you think if this patch is favorable? If yes, I will do dejagnu > test and send it to gcc-patches for review. The patch is probably correct, but I'd ditch hunks #1 and #3. In case1, the code already sets a flag (i3_subst_into_i2) so we're better off not setting another one, lest it badly interacts with the former. Moreover, even if the pattern is not valid, the dest of I3 has nevertheless changed. So hunk #2 alone is sufficient, but the comment isn't quite up to the point. I'd copy and adapt for case2 the comment of case1 instead: /* Replace the dest 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. */ as well as update the comment at the destination: /* We come here when we are replacing a destination in I2 with the destination of I3. */ validate_replacement: which was written for case1 and obviously overlooks case2. You reported the problem against 4.4.x as well and I think the patch would be safe enough as to be put on the branch, but formally the bug needs to be a regression from earlier compilers. Do you know of such a compiler, e.g. 4.3.x, which correctly compiles your testcase for the same target and with the same options? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42691