From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 7F0753858D28; Thu, 10 Feb 2022 10:39:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7F0753858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: F6pz/YywFVntnNIacL01zgaFjcL2tNp/DX5hntqM8bhFNp0BZiKcXA12JJ0KHKWtAyj+XP+Kep aEm/WlS62Uy3DB8bOxhNnU7oEpqdDOUSqLlWtSRoxY/iZPzvSSyVG6NRPUwDmUcpKlipP9K1xv YMnc/qa7tJJj2QzH71ixcQJ/tKxFlCarC77iIx3BTniPmphmKB+3vwJakLbpWC0vhDgMqunLvA U+UBRJ6Y1u4OTic4rZ6QxxV899kHk71LqBDHiroQ5+S5rSrS8hhbyuhBkA0ftWKaGVAe75vfqZ +rxpbKPHeCntOtO38rOZjF+M X-IronPort-AV: E=Sophos;i="5.88,358,1635235200"; d="scan'208";a="71787405" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 10 Feb 2022 02:39:32 -0800 IronPort-SDR: 2K7q3UlsHxqVDt7zKgS3zkeRUZLpD4yZPRcAWSQWxWSxngElAyXj2pTm3cqLYrIZlskeYi2ihl fye+eFlSWcp/NuEaNcPkcH48jF8N2vhLtNWXW3w7w67oLag+KjVkTaybHXNNf3qS3/+HiCXeNx c8vGBW+aGibVM3HtTcy//nXx5zncMXDZapnZgolfdHsNqxuBhXVHPx4EHG2wA6zj1lWIXDylsc jPRh8mK3xov33nGKWCxv87uBNXTuLgCxt0Lsch6MJ6U3dE3wFPApAu7aW+BAyIlYVgAcS4O/Y7 STc= Message-ID: Date: Thu, 10 Feb 2022 11:39:24 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH] gfortran: Respect target's NO_DOT_IN_LABEL in trans-common.cc Content-Language: en-US To: Roger Sayle , , References: <016801d81e66$10d48410$327d8c30$@nextmovesoftware.com> From: Tobias Burnus In-Reply-To: <016801d81e66$10d48410$327d8c30$@nextmovesoftware.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-10.mgc.mentorg.com (139.181.222.10) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Feb 2022 10:39:35 -0000 On 10.02.22 11:07, Roger Sayle wrote: > The fix is to tweak trans-common.cc to respect the target's NO_DOT_IN_LAB= EL > (and NO_DOLLAR_IN_LABEL) when generating internal equiv.%d symbols. In general, I think the patch is okay =E2=80=93 but as '_' is a valid ident= ifier and with -fdollar-ok '$' is valid as well, I wonder whether there should be a prefix and/or a capital letter. Namely: +#if !defined (NO_DOT_IN_LABEL) +#define GFC_EQUIV_FMT "equiv.%d" +#elif !defined (NO_DOLLAR_IN_LABEL) +#define GFC_EQUIV_FMT "equiv$%d" +#else +#define GFC_EQUIV_FMT "equiv_%d" +#endif The first one we want to keep as is for backwards compatibility. And the '.' is fine in this regard. But I think for the other two, we need to do more, e.g., '_Equiv' + '$%d' / '_%d'. The '_' and capital letter should place everything into the compiler namespace (in terms of C/C++) and Fortran itself requires for a name (case insensitive, lower cased by gfortran): [A-Z][A-Z0-9_]* =E2=80=93 thus, '_E' contains two characters not accessible in a normal Fortran program (ignoring bind(C,name=3D"..."). If the _Equiv[_$]%d sounds sensible to you: Please change; if not, what concerns do you have? > Ok for mainline? OK with changing the prefix for the non-dot variant. Tobias > 2022-02-10 Roger Sayle > > gcc/fortran/ChangeLog > * trans-common.cc (GFC_EQUIV_FMT): New macro respecting the > target's NO_DOT_IN_LABEL and NO_DOLLAR_IN_LABEL preferences. > (build_equiv_decl): Use GFC_EQUIV_FMT here. ----------------- 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