From patchwork Thu Nov 24 10:00:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 83834 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp59122qgi; Thu, 24 Nov 2016 02:00:43 -0800 (PST) X-Received: by 10.98.90.132 with SMTP id o126mr1449638pfb.41.1479981643827; Thu, 24 Nov 2016 02:00:43 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id o1si38550103pge.141.2016.11.24.02.00.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Nov 2016 02:00:43 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-442521-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-442521-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-442521-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=KikAwpqUaPCVMP4F/ qtuu+6EquGEasOfshUTc4TTQ+QHtGFQdlfts8rwcMIvcqXMpVGT0rml/xmr6Lf5Q YwMKWffnfYZCCsxgn6BqmkyfYxvil0o7VRuWQEnLDTZ8cL1L05Qd2Yu8+v9rWEau J8ftBKLB6XtV3+8um/82nPC53o= 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=AY81YjBj2yo8THt67uf/Nz8 UbAk=; b=ed+qBwiOtho1IPyg9YayPajKPFJRDlItwFaKutzRmZDm1fV1cy643eR ebA6CoJbpe7Borpz8amA6a8bq1CFardzVMG1CbZKp4gnYE8evDW8WzvAtvsSM/O4 7wepB1MyBAFv9LiU79UMqIVkN9g1tVJLP6hy/RfBj5uWJctMi9co= Received: (qmail 26406 invoked by alias); 24 Nov 2016 10:00:28 -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 26390 invoked by uid 89); 24 Nov 2016 10:00:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, SPF_PASS autolearn=ham version=3.3.2 spammy=2016-11-24 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 24 Nov 2016 10:00:17 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CD2A4ADB8; Thu, 24 Nov 2016 10:00:14 +0000 (UTC) Subject: Re: [PATCH] Fix PR bootstrap/78493 To: Jakub Jelinek , Richard Biener References: <20161124083649.GA3541@tucnak.redhat.com> <20161124090902.GB3541@tucnak.redhat.com> Cc: Jeff Law , GCC Patches From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: Date: Thu, 24 Nov 2016 11:00:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161124090902.GB3541@tucnak.redhat.com> X-IsSubscribed: yes On 11/24/2016 10:09 AM, Jakub Jelinek wrote: > On Thu, Nov 24, 2016 at 09:51:49AM +0100, Richard Biener wrote: >> On Thu, Nov 24, 2016 at 9:36 AM, Jakub Jelinek wrote: >>> On Thu, Nov 24, 2016 at 09:26:25AM +0100, Richard Biener wrote: >>>>> Alternately, given all the problems we have with this kind of problem, we >>>>> should seriously consider throttling back what we consider an error during a >>>>> profiled bootstrap. This kind of stuff is a maintenance nightmare with >>>>> minimal value. >>>> >>>> I think we've always communicated that all non-standard bootstrap configs >>>> need -Wdisable-werror. >>> >>> Normal profiledbootstrap (when not using -O3 or similar) has been always >>> -Werror clean and it would be nice if it stays so. >> >> Oh, this was just profiledbootstrap. Agreed - though the proposed patch is >> still too ugly for my taste. > > Agreed on that. > > Jakub > Attaching second version of the patch which is preapproved by Jakub. I'm going to install the patch as soon as it finishes regression tests. Martin >From 9a39306855554d582f8cca1cc4172717585d4a15 Mon Sep 17 00:00:00 2001 From: marxin Date: Wed, 23 Nov 2016 14:08:52 +0100 Subject: [PATCH] cp_parser_range_for: use safe_push instead of quick_push (PR bootstrap/78493) gcc/cp/ChangeLog: 2016-11-24 Martin Liska PR bootstrap/78493 * parser.c (cp_parser_range_for): Use safe_push instead of quick_push. gcc/testsuite/ChangeLog: 2016-11-24 Jakub Jelinek PR bootstrap/78493 * g++.dg/cpp1z/decomp18.C: New test. --- gcc/cp/parser.c | 8 ++++---- gcc/testsuite/g++.dg/cpp1z/decomp18.C | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp1z/decomp18.C diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 9da4b30..843cbe2 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -11503,8 +11503,8 @@ cp_parser_range_for (cp_parser *parser, tree scope, tree init, tree range_decl, for (unsigned int i = 0; i < decomp_cnt; i++, d = DECL_CHAIN (d)) { tree name = DECL_NAME (d); - names.quick_push (name); - bindings.quick_push (IDENTIFIER_BINDING (name)); + names.safe_push (name); + bindings.safe_push (IDENTIFIER_BINDING (name)); IDENTIFIER_BINDING (name) = IDENTIFIER_BINDING (name)->previous; } @@ -11513,8 +11513,8 @@ cp_parser_range_for (cp_parser *parser, tree scope, tree init, tree range_decl, if (names.is_empty ()) { tree name = DECL_NAME (range_decl); - names.quick_push (name); - bindings.quick_push (IDENTIFIER_BINDING (name)); + names.safe_push (name); + bindings.safe_push (IDENTIFIER_BINDING (name)); IDENTIFIER_BINDING (name) = IDENTIFIER_BINDING (name)->previous; } } diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp18.C b/gcc/testsuite/g++.dg/cpp1z/decomp18.C new file mode 100644 index 0000000..d5c68a2 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/decomp18.C @@ -0,0 +1,12 @@ +// { dg-do compile { target c++11 } } +// { dg-options "" } + +struct A { char a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r; } a[64]; + +void +foo () +{ + int z = 0; + for (auto & [ b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s ] : a) // { dg-warning "decomposition declaration only available with" "" { target c++14_down } } + z += b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q + r + s; +} -- 2.10.2