public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/110957] -ffpe-trap and -ffpe-summary options issues
Date: Fri, 06 Oct 2023 20:19:39 +0000	[thread overview]
Message-ID: <bug-110957-4-0Zwdq9gJ4x@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110957-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110957

--- Comment #2 from anlauf at gcc dot gnu.org ---
Created attachment 56071
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56071&action=edit
Patch to fix mixed up parsing of fpe options

The attached patch fixes the mixup and adds the possibility to specify
-ffpe-trap=none to clear previously enabled exceptions on the command line.
Will submit this to the list.

Regarding the treatment of -f(no-)trapping-math, I played around a little
bit, and I am unsure what to do.

In gfortran, the option -ffpe-trap only sets the FPU mask in the main and
does nothing else.  Which I think is the major (sole?) purpose.

On the other hand, -f(no-)trapping-math has implications that affect
e.g. reassociation.  Adding to gfc_post_options() something like

  if (gfc_option.fpe != 0 && !flag_trapping_math)
    {
      gfc_warning_now (0, "Option %<-ffpe-trap=%> enforces "
                       "%<-ftrapping-math%> for Fortran");
      flag_trapping_math = 1;
    }

will generate different warnings for -O3 -ffast-math, -Ofast, and might
create more confusion than help users.

I tend to think that this part should not be implemented (now), unless
we better understand the implications of what a change of the defaults
in gcc means to gfortran.

  parent reply	other threads:[~2023-10-06 20:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09  9:28 [Bug fortran/110957] New: " ubizjak at gmail dot com
2023-08-13 20:19 ` [Bug fortran/110957] " anlauf at gcc dot gnu.org
2023-10-06 20:19 ` anlauf at gcc dot gnu.org [this message]
2023-10-13 20:07 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110957-4-0Zwdq9gJ4x@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).