[Bug fortran/31269] short-circuit in -fbounds-check

2007-03-20 Thread Tobias dot Schlueter at physik dot uni-muenchen dot de
--- Comment #14 from Tobias dot Schlueter at physik dot uni-muenchen dot de 2007-03-20 21:04 --- Subject: Re: short-circuit in -fbounds-check pinskia at gcc dot gnu dot org wrote: >> But I'll stop this discussion here, and will stay with g95 when I want to >> bound-check my program. >

[Bug fortran/31269] short-circuit in -fbounds-check

2007-03-20 Thread pinskia at gcc dot gnu dot org
--- Comment #13 from pinskia at gcc dot gnu dot org 2007-03-20 20:58 --- > But I'll stop this discussion here, and will stay with g95 when I want to > bound-check my program. Why short circuiting is legal and so is not short circuiting. Yes Gfortran's behavior is semi inconstaint but

[Bug fortran/31269] short-circuit in -fbounds-check

2007-03-20 Thread Tobias dot Schlueter at physik dot uni-muenchen dot de
--- Comment #12 from Tobias dot Schlueter at physik dot uni-muenchen dot de 2007-03-20 20:17 --- Subject: Re: short-circuit in -fbounds-check I'm on your side, mimo, no need to convince me :-) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31269

[Bug fortran/31269] short-circuit in -fbounds-check

2007-03-20 Thread mimo2 at free dot fr
--- Comment #11 from mimo2 at free dot fr 2007-03-20 20:12 --- hi tobi, may-be they have strong arguments as you say, but I've not catched them. And I still believe that if there is an ambiguity in the standard, the solution is to have a -fshort-circuit to let the user decide what he wan

[Bug fortran/31269] short-circuit in -fbounds-check

2007-03-20 Thread tobi at gcc dot gnu dot org
--- Comment #10 from tobi at gcc dot gnu dot org 2007-03-20 19:11 --- Mimo, you rely on behavior that is not specified by the standard. It says explicitly that only, in order to determine the value of an expression, only as much of it needs to be evaluated, as is needed to determine th

[Bug fortran/31269] short-circuit in -fbounds-check

2007-03-20 Thread pinskia at gcc dot gnu dot org
--- Comment #9 from pinskia at gcc dot gnu dot org 2007-03-20 18:57 --- (In reply to comment #8) > Why do you say the code is undefined. The last version (comment #5) is totally > valid, but possible side effects in the function k could lead to different > results depending on the fact t

[Bug fortran/31269] short-circuit in -fbounds-check

2007-03-20 Thread mimo2 at free dot fr
--- Comment #8 from mimo2 at free dot fr 2007-03-20 18:52 --- Why do you say the code is undefined. The last version (comment #5) is totally valid, but possible side effects in the function k could lead to different results depending on the fact that the -fbounds-check is set or no. And

[Bug fortran/31269] short-circuit in -fbounds-check

2007-03-20 Thread pinskia at gcc dot gnu dot org
--- Comment #7 from pinskia at gcc dot gnu dot org 2007-03-20 18:03 --- > I don't see why nobody besides me thinks that consistency Because the code is undefined either way you look at it :). Yes GCC might allow it to work without -fbounds-check but that does not mean it will work somew

[Bug fortran/31269] short-circuit in -fbounds-check

2007-03-20 Thread tobi at gcc dot gnu dot org
--- Comment #6 from tobi at gcc dot gnu dot org 2007-03-20 17:50 --- I don't see why nobody besides me thinks that consistency, whether it's mandated by the standard or not is a user-friendly feature. Yes I understand the arguments for our current behavior, but I'm not going to discuss

[Bug fortran/31269] short-circuit in -fbounds-check

2007-03-20 Thread mimo2 at free dot fr
--- Comment #5 from mimo2 at free dot fr 2007-03-20 08:56 --- OK but in the present situation, the execution could be different wether you have -fbounds-check or not. Let's change the code by program toto implicit none real:: a(100) integer :: i, k a(:) = 1. do i=1,100 if(

[Bug fortran/31269] short-circuit in -fbounds-check

2007-03-19 Thread pinskia at gcc dot gnu dot org
--- Comment #4 from pinskia at gcc dot gnu dot org 2007-03-20 05:54 --- Closing again, this time as won't fix. Fortran is not C/C++/Java. This case if you get -fbounds-check failing, then the bug is in the code and not in Gfortran. Yes the standard might allow for short circuiting but

[Bug fortran/31269] short-circuit in -fbounds-check

2007-03-19 Thread kargl at gcc dot gnu dot org
--- Comment #3 from kargl at gcc dot gnu dot org 2007-03-20 03:09 --- Tobi, this is a bogus request and the PR should be closed. The standard does not require left to right evaluation. It is the responsibility of the programmer to know what she is doing. I think this should be closed

[Bug fortran/31269] short-circuit in -fbounds-check

2007-03-19 Thread tobi at gcc dot gnu dot org
-- tobi at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirme

[Bug fortran/31269] short-circuit in -fbounds-check

2007-03-19 Thread tobi at gcc dot gnu dot org
--- Comment #2 from tobi at gcc dot gnu dot org 2007-03-19 17:37 --- I'm not going to dig through the standard again to dig out the precise wording, but as long as one doesn't actually access the out-of-bound array element the program is valid. Furthermore, the standard allows short-cir

[Bug fortran/31269] short-circuit in -fbounds-check

2007-03-19 Thread pinskia at gcc dot gnu dot org
--- Comment #1 from pinskia at gcc dot gnu dot org 2007-03-19 17:24 --- As mentioned before, this is not really a bug as the fortran says .and. is not short circuiting. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added