From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by sourceware.org (Postfix) with ESMTPS id 1AF363858D28; Sat, 4 Nov 2023 07:57:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1AF363858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1AF363858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::72c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699084632; cv=none; b=ldeoH87z8DZHlgTqdyCt82YHTcECZSkzymMbwRhniQJu4efg7jJaXDm21HMtX4CMiozUS/hbOhuA/YuoO6a2kD3WFHxemwhsgAzyLWSa+zbNJaPaLnlzSV6P8I5anP0VlAwpz+iuie38QQNp6L2TWJmzm06QHW/gKo4pUyNJN6Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699084632; c=relaxed/simple; bh=sLVFiWceQbv6WOoMMpG83uzY844EstKDRMPHCPq0Kdk=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=gXe9xZpbwlW+lmB9wyVzvC9cbH3VEq5zodnCOo8ydSEQiM9OhCrIBeknO03MhdHZ8oEqgAPm+nH3K+jNceeQi0O0M+nVfnVl4LCdiLjTqimlGYkCiKOlS2Gur3Iw1C9nCG7aPHXgfXMDXoPhUSRUajtDwVmHtOAai3+RyCpyPWA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-77891c236fcso185450685a.3; Sat, 04 Nov 2023 00:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699084630; x=1699689430; darn=gcc.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=o1MxwI7MZn8OGVNxl7cgQFYOUewD7b2KsXtVzAn7k88=; b=i7JrtTU2haijOiCepiQpOh9PzW57+cagApUcxbwi9B7R8iM9qkSEdN/PnD9dZk+bIt y616K7F9kHli/8DR10JH2TBg57zsQ71UX+UBNs81ZvICu1RubvdX/b5xZuET+rfKEvrI ab+XgF3HS7pCmvntL63KQNQsoEDwwJq49VRFs11ajioLnWOaQZVTfIbOd7khsfEK49/d O/xpwlw67kuCrwW4q1erFzlIpFxAL9xUo+TdkOdqPZ/VsvIBOmyhu1rxeFeR77W+yM4J EGxHfX8+lST8NFgUbxED1beExgXegZ8FyxZHjfr/oddx/dZL3QTJOOBkTtP9zlwBDADX mDZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699084630; x=1699689430; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=o1MxwI7MZn8OGVNxl7cgQFYOUewD7b2KsXtVzAn7k88=; b=lO76oLliO50dExkoy1nIgi8va1WmeX2If0A+BCdzLcbcnHTa433v6i7SOio92+OVIg 1taH1jntEuliT17/AKnpMm2AQCsxlM9oBnuFnXrIH42QR/OKOBVfC0+eOajvjbn0Tbhc Ijl9Vui+hihxhIMtiTdlkfxmDwbQ9uFUA71o93zM2KJ9PmLL/XcK7ZucGEZy7wZBTc2T 4Y1bANpMLdlPddcshSLnDo93IfCjScXOQ0l6ZPz/wBnuPNYndWVLN36j8+65qwW/9LpR hA1lHO3QiwAMvFhKKJPDgW6qGC7I6qyudvf4gkR3UWFE+ILLZ3w9A2ktsVjt05LI45UG 8e0g== X-Gm-Message-State: AOJu0YxywbnFbLPUCkdBlui1B/5iXZYh7AVWl9gO2QlxVjURVOk8/CM0 oEYbtQx6i8Jz599BJmyDUFLPi7juhg3cpmp4e3LGaxTN X-Google-Smtp-Source: AGHT+IGKg3v/ke80cAx8b4JrBsnMKL2yavPXH9Lgws7F0NOvTU7drGt0DM0SvSjcH13Rw8X8VJnmBpOKwKchASkfg4k= X-Received: by 2002:a05:620a:4510:b0:774:13e4:1f7e with SMTP id t16-20020a05620a451000b0077413e41f7emr27235760qkp.38.1699084630421; Sat, 04 Nov 2023 00:57:10 -0700 (PDT) MIME-Version: 1.0 References: <6544ed9e.050a0220.36ebf.0e8eSMTPIN_ADDED_BROKEN@mx.google.com> In-Reply-To: <6544ed9e.050a0220.36ebf.0e8eSMTPIN_ADDED_BROKEN@mx.google.com> From: Paul Richard Thomas Date: Sat, 4 Nov 2023 07:56:59 +0000 Message-ID: Subject: Re: [PATCH] Fortran: Fix generate_error library function fnspec To: Martin Jambor Cc: GCC Patches , fortran@gcc.gnu.org Content-Type: multipart/alternative; boundary="000000000000d6f36306094ef748" X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,HTML_MESSAGE,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: --000000000000d6f36306094ef748 Content-Type: text/plain; charset="UTF-8" Hi Martin, This looks to be 'obvious' and is certainly OK for mainline. Backport if you wish. Thanks Paul On Fri, 3 Nov 2023 at 12:54, Martin Jambor wrote: > Hi, > > 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 char > *message) > > contains the following: > > /* Report status back to the compiler. */ > cmp->flags &= ~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? > > > 2023-11-02 Martin Jambor > > * trans-decl.cc (gfc_build_builtin_function_decls): Fix fnspec of > 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 = gfc_build_library_function_decl_with_spec ( > - 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); > > -- > 2.42.0 > > --000000000000d6f36306094ef748--