public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/96613] New: SIGFPE on min1() with -ffpe-trap=invalid switch
@ 2020-08-14  9:09 thomas.huxhorn at web dot de
  2020-08-14 15:58 ` [Bug libfortran/96613] " kargl at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: thomas.huxhorn at web dot de @ 2020-08-14  9:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96613
           Summary: SIGFPE on min1() with -ffpe-trap=invalid switch
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thomas.huxhorn at web dot de
  Target Milestone: ---

The program fails if -ffpe-trap=invalid is present and no optimization flag is
set. It print 5000 with any optimization level set.

The expected behavior is that it print 5000 with no optimization.

Perhaps it is possible to first calculate the minimum of both real values and
then convert it to integer?

Testet with gcc 10.1 and 4.9
Compile with gfortran -ffpe-trap=invalid  -g -ggdb -fbacktrace   test.f90 

program test
  implicit none
  real :: X
  integer :: IX

  X = 7.7643945e+09
  IX = MIN1(5000.0, X)
  write(*,*) IX
end program

gdb ./a.out 
(gdb) run
Starting program: /home/thomas/a.out 
Program received signal SIGFPE, Arithmetic exception.
0x0000000000400794 in test () at test.f90:8
8         IX = MIN1(5000.0, X)

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-08-20 18:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-14  9:09 [Bug libfortran/96613] New: SIGFPE on min1() with -ffpe-trap=invalid switch thomas.huxhorn at web dot de
2020-08-14 15:58 ` [Bug libfortran/96613] " kargl at gcc dot gnu.org
2020-08-14 15:59 ` [Bug fortran/96613] " kargl at gcc dot gnu.org
2020-08-16 19:55 ` anlauf at gcc dot gnu.org
2020-08-16 19:55 ` anlauf at gcc dot gnu.org
2020-08-16 21:52 ` kargl at gcc dot gnu.org
2020-08-17 18:03 ` anlauf at gcc dot gnu.org
2020-08-17 18:55 ` sgk at troutmask dot apl.washington.edu
2020-08-17 19:05 ` anlauf at gcc dot gnu.org
2020-08-17 20:37 ` anlauf at gcc dot gnu.org
2020-08-18 19:49 ` cvs-commit at gcc dot gnu.org
2020-08-18 20:08 ` anlauf at gcc dot gnu.org
2020-08-20 18:51 ` thomas.huxhorn at web dot de

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).