From patchwork Tue Sep 25 16:45:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 974621 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-486360-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="j3+89TdT"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="1TgFuoqw"; dkim-atps=neutral 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 42KRmF4l66z9s3C for ; Wed, 26 Sep 2018 02:46:21 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=uASzpbotB3APQKrbCEzJ+nlGAK6U3/xF55wlTOgDIsKn2iH432 jGMmVluqtawHIY6r70HVlueDcyFcoPwy6SuUAcd+8ci5qJQCkUgjM2MdiqifZM+X VaW1orwIK+jVwja075CkZxNQ7jqZ+rpUcpBlVHTES4ZyLQFQnhJFWk0dw= 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:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=NTXdZIwlx5Rv7jlPiwURIjpWf3k=; b=j3+89TdTI1Yn50h7FZ4w NRtfY03LVuNkmgDFQx6oqdSp348YERvDdjiezxleSD+MJzZhQFLHtQ2SBV38m6Rb 1kKweJNmhmdbB48x81N7M++H2AXRIdMUSS6lRo+k48Y5yZ+CtqaiAjdM0WOxBgrT QqxrY6KnJ1tkvp8AW8VSw1E= Received: (qmail 115928 invoked by alias); 25 Sep 2018 16:46:14 -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 115601 invoked by uid 89); 25 Sep 2018 16:45:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: userp2120.oracle.com Received: from userp2120.oracle.com (HELO userp2120.oracle.com) (156.151.31.85) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Sep 2018 16:45:41 +0000 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8PGhfM8002316; Tue, 25 Sep 2018 16:45:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : from : subject : message-id : date : mime-version : content-type; s=corp-2018-07-02; bh=9nJn/q7XmSChFap39kkIa2CbBPZo3i6YZeewV4TPbIk=; b=1TgFuoqwLh/JGIYH8AxINDP4BAmidNHANGqYMVfEgkNL1H9yvZL0BN+edLlqUaDTNK5J SXz/zjkhYNfaDuzAojR4Rf0DyRoJewvEOI4NXLLQlTCe2m1jZIPy6oTyWLsFXivFavp0 pguwrCRn5PXjLrg2QGXbcgw414iv2hR8Ejr4ZXy5/Z+D8y/DsZW1X8w+4ovw5SJmzHxZ Qdl8nuZxmsVFEFpFadXtJksOTI3CqWkjrUyfXYDXKaRMGkv44a7ZBkycsCkm1hMO0x9q hI+V2oIIUozMFQaDSrPHwgpGESKEvTbmbj7HdnU5O2QX2khDf10o90JA2SF+oF3ixlPi KA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2mnvtum669-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Sep 2018 16:45:36 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w8PGjZGv021239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Sep 2018 16:45:35 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w8PGjZus009680; Tue, 25 Sep 2018 16:45:35 GMT Received: from [192.168.1.4] (/79.27.215.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 25 Sep 2018 09:45:35 -0700 To: "gcc-patches@gcc.gnu.org" Cc: Jason Merrill , Nathan Sidwell From: Paolo Carlini Subject: [C++ Patch] PR 84940 ("[7/8/9 Regression] internal compiler error: in build_value_init_noctor, at cp/init.c:465") Message-ID: <6ec42ea8-90b9-7953-bf03-1b1501baa40a@oracle.com> Date: Tue, 25 Sep 2018 18:45:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi, in this error-recovery regression we ICE after a sensible diagnostic emitted by cp_build_unary_op, called by finish_unary_op_expr via build_x_unary_op. In principle we could dig deeper, but I don't think it makes sense for finish_unary_op_expr to go on having seen the error_mark_node returned by build_x_unary_op given that the purpose of its second half is only issuing warnings. Tested x86_64-linux. Thanks, Paolo. ////////////////////// /cp 2018-09-25 Paolo Carlini PR c++/84940 * semantics.c (finish_unary_op_expr): Check return value of build_x_unary_op for error_mark_node. /testsuite 2018-09-25 Paolo Carlini PR c++/84940 * g++.dg/expr/unary4.C: New. Index: cp/semantics.c =================================================================== --- cp/semantics.c (revision 264578) +++ cp/semantics.c (working copy) @@ -2727,13 +2727,14 @@ finish_unary_op_expr (location_t op_loc, enum tree /* TODO: build_x_unary_op doesn't always honor the location. */ result.set_location (combined_loc); - tree result_ovl, expr_ovl; + if (result == error_mark_node) + return result; if (!(complain & tf_warning)) return result; - result_ovl = result; - expr_ovl = expr; + tree result_ovl = result; + tree expr_ovl = expr; if (!processing_template_decl) expr_ovl = cp_fully_fold (expr_ovl); Index: testsuite/g++.dg/expr/unary4.C =================================================================== --- testsuite/g++.dg/expr/unary4.C (nonexistent) +++ testsuite/g++.dg/expr/unary4.C (working copy) @@ -0,0 +1,8 @@ +// PR c++/84940 +// { dg-additional-options -Wno-vla } + +void +foo (int x) +{ + struct {} a[1][x](-a[0]); // { dg-error "wrong type argument to unary minus" } +}