From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id D13F73858D1E for ; Mon, 9 Oct 2023 10:09:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D13F73858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-CSE-ConnectionGUID: fiQYS0HOSvyRc2fcWq2udA== X-CSE-MsgGUID: wXg1vOlYRASastCSfQG5Fw== X-IronPort-AV: E=Sophos;i="6.03,210,1694764800"; d="scan'208";a="18912741" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 09 Oct 2023 02:09:25 -0800 IronPort-SDR: s7fhWDghtiu1wyYxk1HpYJrQm9nBTgXRihV4I88xeGTnmlqkf+C+tPW3VMmEnOELhkY4CMqYI2 sGex3uWbzFwH9u5o5WschtM73Ahw5XKEPDNSXSjar2GFScX/wd+FX7u+vr4H1uPADooYkcBFkd HNedI9Abv68h9sPkerJNdFFVZ3y1KR9S1uHmetf2NlixnwP1a1WZzIvIsKVJVaCOQacIN5pHJO JQY9zqA88yaUUQ6yFoniDuvKX6NHR8FtsyvtwOhw13jyWF5hNPap6rzfpgXG6M4sLZnNQzLaoy Zl0= Message-ID: <3591f8c9-3cc9-4e95-be04-1e99003f3bad@codesourcery.com> Date: Mon, 9 Oct 2023 12:09:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Tobias Burnus Subject: Re: [pushed] analyzer: improvements to out-of-bounds diagrams [PR111155] To: David Malcolm , References: <20231008225854.783706-1-dmalcolm@redhat.com> Content-Language: en-US In-Reply-To: <20231008225854.783706-1-dmalcolm@redhat.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP 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: Hi David, your commit breaks compilation with GCC < 6, here with GCC 5.2: gcc/analyzer/access-diagram.cc: In member function 'void ana::boundaries::a= dd(const ana::access_range&, ana::boundaries::kind)': gcc/analyzer/access-diagram.cc:655:20: error: 'kind' is not a class, namesp= ace, or enumeration (kind =3D=3D kind::HARD) ? "HARD" : "soft"); ^ The problem is ... On 09.10.23 00:58, David Malcolm wrote: > Update out-of-bounds diagrams to show existing string values, > diff --git a/gcc/analyzer/access-diagram.cc b/gcc/analyzer/access-diagram= .cc > index a51d594b5b2..2197ec63f53 100644 > --- a/gcc/analyzer/access-diagram.cc > +++ b/gcc/analyzer/access-diagram.cc > @@ -630,8 +630,8 @@ class boundaries > public: > enum class kind { HARD, SOFT}; ... > @@ -646,6 +646,15 @@ public: Just above the following diff is the line: void add (const access_range &range, enum kind kind) > { > add (range.m_start, kind); > add (range.m_next, kind); > + if (m_logger) > + { > + m_logger->start_log_line (); > + m_logger->log_partial ("added access_range: "); > + range.dump_to_pp (m_logger->get_printer (), true); > + m_logger->log_partial (" (%s)", > + (kind =3D=3D kind::HARD) ? "HARD" : "soft"); > + m_logger->end_log_line (); Actual problem: Playing around also with the compiler explorer shows that GCC 5.2 or likewi= se 5.5 do not like the variable (PARAM_DECL) name "kind" combined with "kind::HAR= D". The following works: (A) Using "kind =3D=3D boundaries::kind::HARD" - i.e. adding "boundaries::" (B) Renaming the parameter name "kind" to something else - like "k" as used in the other functions. Can you fix it? Thanks, Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955