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 6DA77385701E; Fri, 3 Nov 2023 13:22:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6DA77385701E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6DA77385701E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.137.180 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699017757; cv=none; b=wmfmZCFwRDBh+vOMlPDQn+5LtFnz6iehXjBKUDw5+H7wA2HA48G3ZRdwBoFtE5Um/bw2icPwSRwbbG/SBbqutZ6O+zJZKIZXi8JBlvLDpbCR37m+8QvZ/oNxD+s5Fidaf7KIoLUCGqZOCc1cxcbUfYw+sbIex6yLFNzomGgDktU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699017757; c=relaxed/simple; bh=ipDL25HipvrR4H9H5N4FyuEQbBlCA3vaR3P5QvFAqkY=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=O4SCj0kXusqZ025np7x74npoIP1WgbkM9KfmsXSj+GviZ2P+Os4fMYhSqtniEGlsYadjn2bravZOS9sncheoT62u/nDrV/j2tqbwVKJoefZGBkZ+VZgb04mJ0c3EZ6lLwRjPjHrZlQCsQNjuced/2EdZX+vbwFVghJBB2pFuGQo= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: T4a+0lquSpCeP+Kpu/P2FQ== X-CSE-MsgGUID: EW+MTYOUS6+dAvbxOLXMrg== X-IronPort-AV: E=Sophos;i="6.03,273,1694764800"; d="scan'208";a="21769814" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 03 Nov 2023 05:22:25 -0800 IronPort-SDR: ETdi+Gwu88NCqohSvBKnDu7CamiyooUQrhEieO8jx78fyTd8tbixiFCHgsRY/Zp6C/HB1JacJm /i+REGwfG8E965wg537IfO8qxDfGlYGCWcFrDk7r7o/PTPaWhni98YREDUsVrpzvqYA0yWVeBB pkZxdyFB4s2PYIShkRZjCixd1EAXq/iYJVVCJC6My9k9ketZfmMYtnI7pOKVw8zh3TupkQPxl0 K+mPLnEJgcssJpgZPuB75EVKKx8jWXCBRmq9G1cEqfa5SBob3IQAToIRiyYr/VeM++MK77Bqlo ZVs= Message-ID: Date: Fri, 3 Nov 2023 14:22:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Fortran: Fix generate_error library function fnspec Content-Language: en-US To: Martin Jambor , GCC Patches CC: References: From: Tobias Burnus In-Reply-To: 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-12.mgc.mentorg.com (139.181.222.12) 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,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: On 03.11.23 13:54, Martin Jambor wrote: > when developing an otherwise unrelated patch I've discovered that the > fnspec for the Fortran library function generate_error is wrong. It is > currently ". R . R " where the first R describes the first parameter > and means that it "is only read and does not escape." The function > itself, however, with signature: > > bool > generate_error_common (st_parameter_common *cmp, int family, const cha= r *message) > > contains the following: > > /* Report status back to the compiler. */ > cmp->flags &=3D ~IOPARM_LIBRETURN_MASK; > > which does not correspond to the fnspec and breaks testcase > gfortran.dg/large_unit_2.f90 when my patch is applied, since it tries > to re-use the flags from before the call. > > This patch replaces the "R" with "W" which stands for "specifies that > the memory pointed to by the parameter does not escape." > > Bootstrapped and tested on x86_64-linux. OK for master? LGTM - thanks for the fix! Tobias > 2023-11-02 Martin Jambor > > * trans-decl.cc (gfc_build_builtin_function_decls): Fix fnspec o= f > generate_error. > > --- > gcc/fortran/trans-decl.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc > index a3f037bd07b..b86cfec7d49 100644 > --- a/gcc/fortran/trans-decl.cc > +++ b/gcc/fortran/trans-decl.cc > @@ -3821,7 +3821,7 @@ gfc_build_builtin_function_decls (void) > void_type_node, -2, pchar_type_node, pchar_type_node); > > gfor_fndecl_generate_error =3D gfc_build_library_function_decl_with_s= pec ( > - get_identifier (PREFIX("generate_error")), ". R . R ", > + get_identifier (PREFIX("generate_error")), ". W . R ", > void_type_node, 3, pvoid_type_node, integer_type_node, > pchar_type_node); > ----------------- 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