From patchwork Wed Oct 11 19:39:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Anlauf X-Patchwork-Id: 1846956 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=gmx.de header.i=anlauf@gmx.de header.a=rsa-sha256 header.s=s31663417 header.b=g2wN7n3H; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S5NQj2SfYz1yqZ for ; Thu, 12 Oct 2023 06:40:08 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A87E7385C8B1 for ; Wed, 11 Oct 2023 19:40:05 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by sourceware.org (Postfix) with ESMTPS id 3821D3857738; Wed, 11 Oct 2023 19:39:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3821D3857738 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1697053178; x=1697657978; i=anlauf@gmx.de; bh=9Qc4Rx/ueFW1UNc+Zey4531jowwWLvh4C+lrKC4hYA8=; h=X-UI-Sender-Class:From:To:Subject:Date; b=g2wN7n3HM0XruXxYJH0y/drxFzc61BYCAtJWsmoPoYM0Zme4WyK6qsGfx5vV7dV+Xj4hbyIeEgi MXmowGC2G3EPVKGaGvEcVQCQFIbFqrBoSIUM8++IJdBQ4LKbQXcxT79UpmOyqpkPB8Gv2VzqfADHt 5UNI/+xvdfVBAWXbUAFy7+rUgFtu20HhRe+2eLzk4TY03ScX1zn+HtXWXSRhqzXCZ5OeJt/0I3dkA 2qtwAb/Df9LVQk0q1M72kCyCkADkCncnhBEzgCCy6MpepuM//BLpzOmvX6wyqU4xfo+JuS+CGz8P1 bRYoqoTda+RkbaQSYa0JUh81NhgZyJxPt+Ug== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [79.251.14.159] ([79.251.14.159]) by web-mail.gmx.net (3c-app-gmx-bs29.server.lan [172.19.170.81]) (via HTTP); Wed, 11 Oct 2023 21:39:38 +0200 MIME-Version: 1.0 Message-ID: From: Harald Anlauf To: fortran , gcc-patches Subject: [PATCH] Fortran: name conflict between internal procedure and derived type [PR104351] Date: Wed, 11 Oct 2023 21:39:38 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:8RXrxT++H7rlH7AwP8Nyzz5unH7IU7JvyZY2nRdzecBNOkl5fF0Blv6ThJv2L0CPlq5gK JC3SBCxdtG8SG4ZYv9bNbCumwkoDSzScQYlcKer5o3Lc0G/Xqti7Cb3Hi+63b95vrnL4ow3Jt2jB bJkdeURlg/nQAoGHIyYELjP/J9Sb39nCZrQ0qabc0BTApvHcpaxgPzwOJ0T9jJTtd/MdMEsD7p2v RdKwWyMbJ0m6NezkMta28VKT3ctzkpe0vV109Ucbv+MtW1YSyMmXdY7MNoC/J6OeSsWimM247z9J eM= UI-OutboundReport: notjunk:1;M01:P0:ekSg1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ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Dear All, the attached trivial patch fixes (= catches) a forgotten corner-case in the detection of a name conflict between an internal procedure and a local declaration for the case that the latter is a derived type. Another torture test by Gerhard... ;-) Used to ICE previously. Regtested on x86_64-pc-linux-gnu. OK for mainline? Thanks, Harald From 75dc455f21cea07e64b422c9994ab8879df388de Mon Sep 17 00:00:00 2001 From: Harald Anlauf Date: Fri, 6 Oct 2023 22:21:56 +0200 Subject: [PATCH] fortran: fix handling of options -ffpe-trap and -ffpe-summary [PR110957] gcc/fortran/ChangeLog: PR fortran/110957 * invoke.texi: Update documentation to reflect '-ffpe-trap=none'. * options.cc (gfc_handle_fpe_option): Fix mixup up of error messages for options -ffpe-trap and -ffpe-summary. Accept '-ffpe-trap=none' to clear FPU traps previously set on command line. --- gcc/fortran/invoke.texi | 6 ++++-- gcc/fortran/options.cc | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi index 38150b1e29e..10387e39501 100644 --- a/gcc/fortran/invoke.texi +++ b/gcc/fortran/invoke.texi @@ -1294,7 +1294,8 @@ Specify a list of floating point exception traps to enable. On most systems, if a floating point exception occurs and the trap for that exception is enabled, a SIGFPE signal will be sent and the program being aborted, producing a core file useful for debugging. @var{list} -is a (possibly empty) comma-separated list of the following +is a (possibly empty) comma-separated list of either @samp{none} (to +clear the set of exceptions to be trapped), or of the following exceptions: @samp{invalid} (invalid floating point operation, such as @code{SQRT(-1.0)}), @samp{zero} (division by zero), @samp{overflow} (overflow in a floating point operation), @samp{underflow} (underflow @@ -1314,7 +1315,8 @@ If the option is used more than once in the command line, the lists will be joined: '@code{ffpe-trap=}@var{list1} @code{ffpe-trap=}@var{list2}' is equivalent to @code{ffpe-trap=}@var{list1},@var{list2}. -Note that once enabled an exception cannot be disabled (no negative form). +Note that once enabled an exception cannot be disabled (no negative form), +except by clearing all traps by specifying @samp{none}. Many, if not most, floating point operations incur loss of precision due to rounding, and hence the @code{ffpe-trap=inexact} is likely to diff --git a/gcc/fortran/options.cc b/gcc/fortran/options.cc index 27311961325..2ad22478042 100644 --- a/gcc/fortran/options.cc +++ b/gcc/fortran/options.cc @@ -555,9 +555,12 @@ gfc_handle_fpe_option (const char *arg, bool trap) pos++; result = 0; - if (!trap && strncmp ("none", arg, pos) == 0) + if (strncmp ("none", arg, pos) == 0) { - gfc_option.fpe_summary = 0; + if (trap) + gfc_option.fpe = 0; + else + gfc_option.fpe_summary = 0; arg += pos; pos = 0; continue; @@ -586,7 +589,7 @@ gfc_handle_fpe_option (const char *arg, bool trap) break; } } - if (!result && !trap) + if (!result && trap) gfc_fatal_error ("Argument to %<-ffpe-trap%> is not valid: %s", arg); else if (!result) gfc_fatal_error ("Argument to %<-ffpe-summary%> is not valid: %s", arg); -- 2.35.3