From patchwork Fri Jan 13 10:31:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramana Radhakrishnan X-Patchwork-Id: 135777 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 57811B6F71 for ; Fri, 13 Jan 2012 21:31:49 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1327055509; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=Q8oankz gdDWFGQ0U/r3i/CGYj/0=; b=HRzyEaQ1YrtJXw+qe5yRTwStBNmA3mp0bPuq6tF FqlqNZHoVBphPDumMLYo8+bG5mb/oi6YSLuDKbt4aIFMKt6sxEJtASmKwnOCLMbR Qtl4qvKRH/IoGR+kXcPTcvbCoXfIMWHaYhEVyS3uaRvpuudommKGtbN3A5g4aJn0 0Hp4= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=MLjURdah+3kEVv9VyEH0FvgV9zljkJZ3OAV/GPtHHXZz03Rzdnaf95v2JHJCAF wpcwrmUMGz9Lv+Rp7/dtEbzF99Us+4+YMs4LiDkw7mcr8kZq7MM360UcMcZlpo+T L5IIeTMWcw94/ZYJnKyoyeqrHDpaHZDHzEwDOMQZ0am4I=; Received: (qmail 24807 invoked by alias); 13 Jan 2012 10:31:45 -0000 Received: (qmail 24797 invoked by uid 22791); 13 Jan 2012 10:31:45 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-tul01m020-f175.google.com (HELO mail-tul01m020-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 Jan 2012 10:31:32 +0000 Received: by obbuo6 with SMTP id uo6so2312537obb.20 for ; Fri, 13 Jan 2012 02:31:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.43.10 with SMTP id s10mr141481obl.43.1326450692079; Fri, 13 Jan 2012 02:31:32 -0800 (PST) Received: by 10.182.202.72 with HTTP; Fri, 13 Jan 2012 02:31:32 -0800 (PST) Date: Fri, 13 Jan 2012 10:31:32 +0000 Message-ID: Subject: [RFC combine] PR48308 - Fix issue with missing(?) LOG_LINKS From: Ramana Radhakrishnan To: gcc-patches Cc: Patch Tracking X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, PR48308 is a case where on the ARM port we incorrectly delete a call to strcmp assuming that this is dead. However the problem starts early enough in combine where when try_combine is given i2 of the form (parallel [(set (reg:CC X) (compare:CC OP (const_int 0))) (set Y OP)]) and i1 is NULL it transforms this to : (set Y OP) and change I2 to be (set (reg:CC X) (compare:CC Y (const_int 0))) but in the snippet of code that changes i1 and i2 we don't seem to update LOG_LINKS . We then go and check if i1_feeds_into_i2 and that check relies on the LOG_LINKS being up-to-date. We find that i2 can be combined with i3 *but* we've then gone and made a transformation that results in Y being used but miss out emitting the set of Y. The attached patch appears to fix the problem for the reduced testcase and reduced^2 testcase attached to PR48308. Unfortunately this doesn't fix the testcase from PR50313 which prima-facie was a dup of this bug which I'm still investigating. This has survived bootstrap on x86_64 and is running tests there ( though based on a quick reading of the x86 backend I couldn't find any parallels of that form) and is still undergoing a full bootstrap run on an ARM board. Thoughts ? cheers Ramana #endif diff --git a/gcc/combine.c b/gcc/combine.c index 4178870..f6b8769 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2865,6 +2865,8 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p, SUBST (PATTERN (i2), XVECEXP (PATTERN (i2), 0, 0)); SUBST (XEXP (SET_SRC (PATTERN (i2)), 0), SET_DEST (PATTERN (i1))); + LOG_LINKS (i2) = alloc_insn_link (i1, LOG_LINKS (i2)); + } }