public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/57628] New: spurious error: division by zero in if statement
@ 2013-06-16  6:39 furue at hawaii dot edu
  2013-06-16  7:22 ` [Bug fortran/57628] " kargl at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: furue at hawaii dot edu @ 2013-06-16  6:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628

            Bug ID: 57628
           Summary: spurious error: division by zero in if statement
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: furue at hawaii dot edu

Dear gfortran maintainers,

Division by zero causes error even when it's not executed:

program try
  implicit NONE
  real, parameter:: a = 0.0
  if (a > 0) then
    write(*,*) 1/a
  end if
end program try

$ /usr/bin/gfortran tmp.f90
tmp.f90:5.16:

    write(*,*) 1/a
                1
Error: Division by zero at (1)
$

If it's difficult to give a correct diagnosis, please demote this to a warning.

I have a lot of constructs like this because I change the parameter often and
so this behavior of gfortran is very inconvenient (because I have to rewrite my
source code to be able to compile it).

Regards,
Ryo


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

end of thread, other threads:[~2013-06-18  1:56 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-16  6:39 [Bug fortran/57628] New: spurious error: division by zero in if statement furue at hawaii dot edu
2013-06-16  7:22 ` [Bug fortran/57628] " kargl at gcc dot gnu.org
2013-06-16  7:57 ` furue at hawaii dot edu
2013-06-16  8:13 ` furue at hawaii dot edu
2013-06-16  8:26 ` pinskia at gcc dot gnu.org
2013-06-16  8:47 ` furue at hawaii dot edu
2013-06-16  8:50 ` furue at hawaii dot edu
2013-06-16 14:34 ` dominiq at lps dot ens.fr
2013-06-16 14:55 ` sgk at troutmask dot apl.washington.edu
2013-06-16 23:28 ` furue at hawaii dot edu
2013-06-16 23:33 ` furue at hawaii dot edu
2013-06-17  5:00 ` sgk at troutmask dot apl.washington.edu
2013-06-17  5:00 ` sgk at troutmask dot apl.washington.edu
2013-06-17 18:54 ` anlauf at gmx dot de
2013-06-17 21:25 ` furue at hawaii dot edu
2013-06-17 21:42 ` furue at hawaii dot edu
2013-06-18  1:47 ` furue at hawaii dot edu
2013-06-18  1:56 ` furue at hawaii dot edu

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