This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31119] -fbounds-check: Check for presence of optional arguments before bound checking
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Mar 2007 08:47:43 -0000
- Subject: [Bug fortran/31119] -fbounds-check: Check for presence of optional arguments before bound checking
- References: <bug-31119-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from burnus at gcc dot gnu dot org 2007-03-10 08:47 -------
The problem is that the bounds of an optional argument are checked,
regardlessly whether it is present.
int8 ubound.0;
if (ivec != 0B)
{
ubound.0 = (ivec->dim[0].ubound - ivec->dim[0].lbound) + 1;
}
{
int8 D.1373;
if ((logical4) __builtin_expect ((int8) (D.1373 > 0 && ubound.0 <= 0), 0))
{
_gfortran_runtime_error ("Array reference out of bounds, upper bound of
dimension 1 of array \'ivec\' exceeded (in file \'x.f90
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Bogus "array abound |-fbounds-check: Check for
|mismatch" for -fbounds-check|presence of optional
| |arguments before bound
| |checking
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31119