This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31269] New: short-circuit in -fbounds-check
- From: "mimo2 at free dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Mar 2007 17:16:11 -0000
- Subject: [Bug fortran/31269] New: short-circuit in -fbounds-check
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
program toto
implicit none
real :: a(10)
integer :: i
a(:) = 1.
do i=1,100
if( i <= 10 .and. a(i) > 0. ) write(*,*) i,a(i)
enddo
end
Compiling this program with -fbounds-check will give an out-of-bound error
because the bound checking happens before the evaluation of the expression.
As short-circuit (i.e. not evaluating the second part of the expression when
its result is determined by the first part) is used by gfortran, it would be
nice to use it also for bound checking (at least as an option).
--
Summary: short-circuit in -fbounds-check
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mimo2 at free dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31269