From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by sourceware.org (Postfix) with ESMTPS id F2BF5385840D; Thu, 1 Jun 2023 18:11:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F2BF5385840D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5149e65c218so1782902a12.2; Thu, 01 Jun 2023 11:11:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685643064; x=1688235064; h=mime-version:references:in-reply-to:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=KW8NztKDLLPFh07lvAD/+ermxW4Ce9BzCfMb97C5aHo=; b=cFDuzWNLWZOzqaPp2YEB7+tmE4i4EPTX1ZWitmESbMJgOSQvvqLTea+JisedOpr7FN WxKbg/joXnMOcfwg2eR5Q5ZGBVjeCwvHQFqkr/Rg9rMR0OJOHzoSrdDLLW/IS43+iDF4 ttSMLuBBtj+ZZ68WDSB09cAyuWuMq6h38rOV1J7f0iTL3fRyBVpOr3sxYeD5ifJ0NpRR MBG7OrIZ+Z6tKbuZaUEGT26Vkq1+PCyngapnHi2vzS4Y0HFGqrrde4/FLmCLquiRJzz0 9+tTjrpGUepL6Bgw/1RGADqLGAWjIx5JlbntjuUMuQuIVTTM7z6vnXIDL0BvA2YyNQGc 8S0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685643064; x=1688235064; h=mime-version:references:in-reply-to:message-id:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KW8NztKDLLPFh07lvAD/+ermxW4Ce9BzCfMb97C5aHo=; b=exvIcHLeA1slUra/DlSNKZ7xBpEKhqVTc9OP4wCTMt8f7Xm9ZfSJyO3qI0Xl2uhDZB PokVuQ5lngKlua6xOyhBkRe/Jg7FExBSdBYX1KZjheamZUuW7X7EsyrHulRT1SGofcu6 L2Hh++WBu0XGWNIk2sGFSUKyExJTTCjepoZkUs+SQpXcLclGaoZFvXEc8hr3VjHe3NtC oLY3LZSyQOJxCVEBUM/MtS8Oqf9NDwD4SlHb43MUaCcXUxZogKwDfqbPGwVzmfzKffKa JILZFms7z5rUmd5cInIxERJhR6axZC5pXNyUQqVIN7fcEk3S+DKYR8M+QutOY+8gcczo dRVQ== X-Gm-Message-State: AC+VfDzf1K+ERiN93uxGdEvScK1LJod+x/WfR/a6OWAitbkKoCh+XCYY I+qpdNrA4k8rrZcQ5zJp7vQ= X-Google-Smtp-Source: ACHHUZ4SOPnDKdfqHdVKEg+s8DpJ8oSJiX3scicuL6a2/WQSeQthzdxPwn4d1Fe6EAVrULHdptLU3w== X-Received: by 2002:aa7:d817:0:b0:514:9d17:d6e8 with SMTP id v23-20020aa7d817000000b005149d17d6e8mr425141edq.26.1685643064363; Thu, 01 Jun 2023 11:11:04 -0700 (PDT) Received: from nbbrfq.loc (80-110-214-113.static.upcbusiness.at. [80.110.214.113]) by smtp.gmail.com with ESMTPSA id n18-20020a05640204d200b0050d8aac0a1esm7537872edw.19.2023.06.01.11.11.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 11:11:03 -0700 (PDT) Date: Thu, 1 Jun 2023 20:10:07 +0200 From: Bernhard Reutner-Fischer To: Patrick Palka , David Malcolm Cc: gcc-patches@gcc.gnu.org, Bernhard Reutner-Fischer Subject: Re: [PATCH 04/14] c++: use _P() defines from tree.h Message-ID: <20230601201007.28f7ca15@nbbrfq.loc> In-Reply-To: <20230601183346.71664610@nbbrfq.loc> References: <20230513232321.279733-1-rep.dot.nop@gmail.com> <20230513232321.279733-5-rep.dot.nop@gmail.com> <20230601183346.71664610@nbbrfq.loc> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/alcSPJZTJo1GU5U/vtGZVy9" X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --MP_/alcSPJZTJo1GU5U/vtGZVy9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi David, Patrick, On Thu, 1 Jun 2023 18:33:46 +0200 Bernhard Reutner-Fischer wrote: > On Thu, 1 Jun 2023 11:24:06 -0400 > Patrick Palka wrote: >=20 > > On Sat, May 13, 2023 at 7:26=E2=80=AFPM Bernhard Reutner-Fischer via > > Gcc-patches wrote: =20 >=20 > > > diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc > > > index 131b212ff73..19dfb3ed782 100644 > > > --- a/gcc/cp/tree.cc > > > +++ b/gcc/cp/tree.cc > > > @@ -1173,7 +1173,7 @@ build_cplus_array_type (tree elt_type, tree ind= ex_type, int dependent) > > > } > > > > > > /* Avoid spurious warnings with VLAs (c++/54583). */ > > > - if (TYPE_SIZE (t) && EXPR_P (TYPE_SIZE (t))) > > > + if (CAN_HAVE_LOCATION_P (TYPE_SIZE (t))) =20 > >=20 > > Hmm, this change seems undesirable... =20 >=20 > mhm, yes that is misleading. I'll prepare a patch to revert this. > Let me have a look if there were other such CAN_HAVE_LOCATION_P changes > that we'd want to revert. Sorry for that! I'd revert the hunk above and the one in gcc-rich-location.cc (maybe_range_label_for_tree_type_mismatch::get_text), please see attached. Bootstrap running, ok for trunk if it passes? thanks, --MP_/alcSPJZTJo1GU5U/vtGZVy9 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-c-analyzer-Expand-CAN_HAVE_LOCATION_P-macro.patch >From 322bce380144b5199cca5775f7a3f0fb30a219ae Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 1 Jun 2023 19:44:19 +0200 Subject: [PATCH] c++, analyzer: Expand CAN_HAVE_LOCATION_P macro. r14-985-gca2007a9bb3074 used the collapsed macro definition CAN_HAVE_LOCATION_P in gcc-rich-location.cc and r14-977-g8861c80733da5c in c++'s build_cplus_array_type (). However, although otherwise correct, the usage of CAN_HAVE_LOCATION_P in these two spots is misleading, so this patch reverts aforementioned two hunks. gcc/cp/ChangeLog: * tree.cc (build_cplus_array_type): Revert using the macro CAN_HAVE_LOCATION_P. gcc/ChangeLog: * gcc-rich-location.cc (maybe_range_label_for_tree_type_mismatch::get_text): Revert using the macro CAN_HAVE_LOCATION_P. --- gcc/cp/tree.cc | 2 +- gcc/gcc-rich-location.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc index 19dfb3ed782..9363166152a 100644 --- a/gcc/cp/tree.cc +++ b/gcc/cp/tree.cc @@ -1173,7 +1173,7 @@ build_cplus_array_type (tree elt_type, tree index_type, int dependent) } /* Avoid spurious warnings with VLAs (c++/54583). */ - if (CAN_HAVE_LOCATION_P (TYPE_SIZE (t))) + if (TYPE_SIZE (t) && EXPR_P (TYPE_SIZE (t))) suppress_warning (TYPE_SIZE (t), OPT_Wunused); /* Push these needs up to the ARRAY_TYPE so that initialization takes diff --git a/gcc/gcc-rich-location.cc b/gcc/gcc-rich-location.cc index edecf07f81e..d02a5144cc6 100644 --- a/gcc/gcc-rich-location.cc +++ b/gcc/gcc-rich-location.cc @@ -200,7 +200,7 @@ maybe_range_label_for_tree_type_mismatch::get_text (unsigned range_idx) const tree expr_type = TREE_TYPE (m_expr); tree other_type = NULL_TREE; - if (CAN_HAVE_LOCATION_P (m_other_expr)) + if (m_other_expr && EXPR_P (m_other_expr)) other_type = TREE_TYPE (m_other_expr); range_label_for_type_mismatch inner (expr_type, other_type); -- 2.30.2 --MP_/alcSPJZTJo1GU5U/vtGZVy9--