From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2358 invoked by alias); 1 Feb 2014 00:01:24 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 2349 invoked by uid 89); 1 Feb 2014 00:01:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_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 ESMTP; Sat, 01 Feb 2014 00:01:23 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1101Knq007022 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 31 Jan 2014 19:01:20 -0500 Received: from Mair-2.local (vpn-62-164.rdu2.redhat.com [10.10.62.164]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s1101JQu025267 for ; Fri, 31 Jan 2014 19:01:20 -0500 Message-ID: <52EC394E.6010807@redhat.com> Date: Sat, 01 Feb 2014 00:01:00 -0000 From: Vladimir Makarov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: GCC Mailing List Subject: patch to fix PR59985 Content-Type: multipart/mixed; boundary="------------000205000609020803090202" X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00000.txt.bz2 This is a multi-part message in MIME format. --------------000205000609020803090202 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 470 The following patch fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59985 The patch was successfully bootstrapped on x86/x86-64. Committed as rev. 207375. 2014-01-31 Vladimir Makarov PR bootstrap/59985 * lra-constraints.c (process_alt_operands): Update reload_sum only on the first pass. 2014-01-31 Vladimir Makarov PR bootstrap/59985 * gcc.target/arm/pr59985.C: New. --------------000205000609020803090202 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="pr59985.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr59985.patch" Content-length: 2537 Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 207366) +++ lra-constraints.c (working copy) @@ -2178,7 +2178,11 @@ process_alt_operands (int only_alternati (operand_reg[nop])] .last_reload); - if (last_reload > bb_reload_num) + /* The value of reload_sum has sense only if we + process insns in their order. It happens only on + the first constraints sub-pass when we do most of + reload work. */ + if (lra_constraint_iter == 1 && last_reload > bb_reload_num) reload_sum += last_reload - bb_reload_num; } /* If this is a constant that is reloaded into the Index: testsuite/gcc.target/arm/pr59985.C =================================================================== --- testsuite/gcc.target/arm/pr59985.C (revision 0) +++ testsuite/gcc.target/arm/pr59985.C (working copy) @@ -0,0 +1,68 @@ +/* { dg-do compile } */ +/* { dg-options "-g -fcompare-debug -O2 -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=hard" } */ + +extern void *f1 (unsigned long, unsigned long); +extern const struct line_map *f2 (void *, int, unsigned int, const char *, unsigned int); +extern unsigned int f3 (void *, unsigned int); +extern void *v1; +struct B { const char *s; int t; }; +struct C { unsigned u; unsigned long long v; void *w; }; +unsigned long long f4 (struct C *); +const char *f5 (void *, unsigned int, unsigned int *); +unsigned long long f6 (void *); + +static inline unsigned long long +f7 (struct C *x, unsigned y) +{ + unsigned long long a, b; + int u = x->u; + a = y == 64 ? -1ULL : (1ULL << y) - 1; + if (u + y > 64) + { + f6 (x->w); + x->u = y; + return b & a; + } + b = x->v; + b >>= u; + x->u = u + y; + return b & a; +} + +static const char * +f8 (const char *x) +{ + B **a; + unsigned long t = __builtin_strlen (x); + char *b; + struct B *c; + b = (char *) f1 (t + 1, 1); + c = (struct B *) f1 (1, sizeof (struct B)); + __builtin_memcpy (b, x, t + 1); + c->t = t; + struct B *d = *a; + return d->s; +} + +unsigned int +f9 (struct C *x, void *y) +{ + static const char *a; + static int b; + static int c; + bool d, e, f; + unsigned t; + bool prev_file = a != __null; + if (f7 (x, 1)) + return ((unsigned int) 0); + d = f7 (x, 1); + e = f7 (x, 1); + f = f7 (x, 1); + a = f8 (f5 (y, f4 (x), &t)); + if (e) b = f4 (x); + if (f) + if (d) + if (prev_file) + f2 (v1, 1, false, __null, 0); + return f3 (v1, c); +} --------------000205000609020803090202--