[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-17 Thread furue at hawaii dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #19 from Ryo Furue --- (In reply to Ryo Furue from comment #18) Sorry again. I made English error. > > Yeah, I get it. You don't like the choice that gfortran > > made 10+ years ago. > > Not quite. I meant, You are not quite rig

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-17 Thread furue at hawaii dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #18 from Ryo Furue --- (In reply to Steve Kargl from comment #17) > > real, parameter:: a = -1.0 > > if (a > 0) write(*,*) sqrt(a) > > > > With such a switch turned on, the compiler can replace sqrt(-1.0) with NaN > > and > > le

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-17 Thread sgk at troutmask dot apl.washington.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #17 from Steve Kargl --- On Mon, Jun 17, 2013 at 10:07:32PM +, furue at hawaii dot edu wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 > > --- Comment #16 from Ryo Furue --- > (In reply to Steve Kargl from comment #12)

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-17 Thread furue at hawaii dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #16 from Ryo Furue --- (In reply to Steve Kargl from comment #12) > On Sun, Jun 16, 2013 at 11:33:49PM +, furue at hawaii dot edu wrote: > > > > Is this an inconsistency in the implementation of -no-range-check ? > > No. Then, w

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-17 Thread furue at hawaii dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #15 from Ryo Furue --- (In reply to Harald Anlauf from comment #13) Hi Harald, Thanks for your message. > I would also prefer if gfortran behaved as you suggested. > Other compilers appear to generate warnings only, or no comment. >

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-17 Thread furue at hawaii dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #14 from Ryo Furue --- (In reply to Steve Kargl from comment #11) > > Overall, I think this kind of thing is better be a "warning" and that at > > least > > the compiler should allow the user to run such a code as this. The result

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-17 Thread anlauf at gmx dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 Harald Anlauf changed: What|Removed |Added CC||anlauf at gmx dot de --- Comment #13 from

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-16 Thread sgk at troutmask dot apl.washington.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #12 from Steve Kargl --- On Sun, Jun 16, 2013 at 11:33:49PM +, furue at hawaii dot edu wrote: > > Is this an inconsistency in the implementation of -no-range-check ? No. > > I would be nice if there were an option to demote thi

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-16 Thread sgk at troutmask dot apl.washington.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #11 from Steve Kargl --- On Sun, Jun 16, 2013 at 11:28:36PM +, furue at hawaii dot edu wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 > > --- Comment #9 from Ryo Furue --- > (In reply to Steve Kargl from comment #8) >

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-16 Thread furue at hawaii dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #10 from Ryo Furue --- (In reply to Dominique d'Humieres from comment #7) > AFAICT the option -fno-range-check is what you are looking for. Thanks! That's exactly it. But, I'm curious. The following code still fails to compile even

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-16 Thread furue at hawaii dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #9 from Ryo Furue --- (In reply to Steve Kargl from comment #8) > So, the compiler should just arbitrarily chose to evaluate > some expression and ignore others? No, I don't mean that. I'm not saying which expression the compiler sh

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-16 Thread sgk at troutmask dot apl.washington.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #8 from Steve Kargl --- On Sun, Jun 16, 2013 at 07:57:23AM +, furue at hawaii dot edu wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 > > --- Comment #2 from Ryo Furue --- > > Of course. I agree with all your stateme

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-16 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #7 from Dominique d'Humieres --- AFAICT the option -fno-range-check is what you are looking for.

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-16 Thread furue at hawaii dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #6 from Ryo Furue --- (In reply to Ryo Furue from comment #5) I'm correcting two typos. Sorry. > (In reply to Andrew Pinski from comment #4) > > parameter are special in fortran. The expression is evaluated at compile > > time beca

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-16 Thread furue at hawaii dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #5 from Ryo Furue --- (In reply to Andrew Pinski from comment #4) > parameter are special in fortran. The expression is evaluated at compile > time because of the parameter. a has to be replaced with 0 according to the > fortran stan

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-16 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #4 from Andrew Pinski --- >Since my code includes an expression that can be evaluated at compile time and >it's a division by zero, parameter are special in fortran. The expression is evaluated at compile time because of the paramet

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-16 Thread furue at hawaii dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #3 from Ryo Furue --- (In reply to kargl from comment #1) Thank you for the prompt response! [This is a re-post. I missed the "reply" feature and made a typo. I would delete the other post, if possible.] > But, it is evaluated at co

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-16 Thread furue at hawaii dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 --- Comment #2 from Ryo Furue --- Thank you for the prompt response! > But, it is evaluated at compile time, and so, you'll > get the error. I understand that. > You are getting the correct diagnosis! Of course. I agree with all your statemen

[Bug fortran/57628] spurious error: division by zero in if statement

2013-06-16 Thread kargl at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628 kargl at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC|