------- 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

Reply via email to