From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 11 01:50:45 2014 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E458B173; Sat, 11 Jan 2014 01:50:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CFA3B13A1; Sat, 11 Jan 2014 01:50:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0B1ojxd098639; Sat, 11 Jan 2014 01:50:45 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0B1oj7B098638; Sat, 11 Jan 2014 01:50:45 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201401110150.s0B1oj7B098638@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 11 Jan 2014 01:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r260530 - stable/8/contrib/gcc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2014 01:50:46 -0000 Author: pfg Date: Sat Jan 11 01:50:45 2014 New Revision: 260530 URL: http://svnweb.freebsd.org/changeset/base/260530 Log: MFC r260361: gcc: Fix optimization bug. GCC-PR rtl-optimization/34628 * combine.c (try_combine): Stop and undo after the first combination if an autoincrement side-effect on the first insn has effectively been lost. Modified: stable/8/contrib/gcc/combine.c Directory Properties: stable/8/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/gcc/ (props changed) Modified: stable/8/contrib/gcc/combine.c ============================================================================== --- stable/8/contrib/gcc/combine.c Sat Jan 11 01:45:20 2014 (r260529) +++ stable/8/contrib/gcc/combine.c Sat Jan 11 01:50:45 2014 (r260530) @@ -2370,12 +2370,17 @@ try_combine (rtx i3, rtx i2, rtx i1, int if (i1 && GET_CODE (newpat) != CLOBBER) { - /* Before we can do this substitution, we must redo the test done - above (see detailed comments there) that ensures that I1DEST - isn't mentioned in any SETs in NEWPAT that are field assignments. */ - - if (! combinable_i3pat (NULL_RTX, &newpat, i1dest, NULL_RTX, - 0, (rtx*) 0)) + /* Check that an autoincrement side-effect on I1 has not been lost. + This happens if I1DEST is mentioned in I2 and dies there, and + has disappeared from the new pattern. */ + if ((FIND_REG_INC_NOTE (i1, NULL_RTX) != 0 + && !i1_feeds_i3 + && dead_or_set_p (i2, i1dest) + && !reg_overlap_mentioned_p (i1dest, newpat)) + /* Before we can do this substitution, we must redo the test done + above (see detailed comments there) that ensures that I1DEST + isn't mentioned in any SETs in NEWPAT that are field assignments. */ + || !combinable_i3pat (NULL_RTX, &newpat, i1dest, NULL_RTX, 0, 0)) { undo_all (); return 0;