--- 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.
>
--- 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
--- 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
--- 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
--- 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
--- 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
--- 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
--- 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
--- 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
--- 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(
--- 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
--- 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
--
tobi at gcc dot gnu dot org changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirme
--- 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
--- 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
15 matches
Mail list logo