From patchwork Thu Sep 18 16:04:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 390848 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 798A414018C for ; Fri, 19 Sep 2014 02:04:42 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=YopTWa5BfVgCojMJaO4K8rvnqCei9nqOH7vS+rpOEyNOje Q1inHpt5vFNGcIAcgNZf6KH/xI5z/YrGi3RbUaPbyC2o1IoI/WgKxufKI+CTLXOh qtF77Fe61Muuqw9ro1MBoZGR1IlRRI915yuQabXFNwC+Ei7FbfTUvtKmcuSQc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=mVqDkNRQYAQPW0QR+aG8IisHdyw=; b=Noo9pwCJtq13PBaiupQQ l2vskSPSI7Fvlw+Webo0XlY61gAUbBQkwOR5HHNz2SftJAAyiV3zxX61SVL9aAPY Lg08VsUssru3b3OAHPym6a7mXcOk8CLB12nswBFNkc3z+ImnSdAjuO4mCfXLd5UX zhTqB8IWueBT3kQYKLKDOXs= Received: (qmail 26315 invoked by alias); 18 Sep 2014 16:04:34 -0000 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 Received: (qmail 26299 invoked by uid 89); 18 Sep 2014 16:04:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 18 Sep 2014 16:04:32 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8IG4UvT025128 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 18 Sep 2014 12:04:31 -0400 Received: from topor.usersys.redhat.com ([10.15.16.142]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8IG4US5031556 for ; Thu, 18 Sep 2014 12:04:30 -0400 Message-ID: <541B028E.9010308@redhat.com> Date: Thu, 18 Sep 2014 12:04:30 -0400 From: Vladimir Makarov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: gcc-patches Subject: Patch to fix PR61360 X-IsSubscribed: yes The following patch fixes the PR. The details can be found on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61360 The patch was bootstrapped and tested on x86/x86-64. Committed as rev. 215358. 2014-09-18 Vladimir Makarov PR target/61360 * lra.c (lra): Call recog_init. 2014-09-18 Vladimir Makarov PR target/61360 * gcc.target/i386/pr61360.c: New. Index: lra.c =================================================================== --- lra.c (revision 215337) +++ lra.c (working copy) @@ -2135,6 +2135,11 @@ lra (FILE *f) lra_in_progress = 1; + /* The enable attributes can change their values as LRA starts + although it is a bad practice. To prevent reuse of the outdated + values, clear them. */ + recog_init (); + lra_live_range_iter = lra_coalesce_iter = 0; lra_constraint_iter = lra_constraint_iter_after_spill = 0; lra_inheritance_iter = lra_undo_inheritance_iter = 0; Index: testsuite/gcc.target/i386/pr61360.c =================================================================== --- testsuite/gcc.target/i386/pr61360.c (revision 0) +++ testsuite/gcc.target/i386/pr61360.c (working copy) @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-march=amdfam10 -O2" } */ +int a, b, c, e, f, g, h; +long *d; +__attribute__((cold)) void fn1() { + int i = g | 1; + for (; g; h++) { + for (; a; e++) d[0] = c; + if (0.002 * i) break; + for (; b; f++) d[h] = 0; + } +}