This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/28849] Missed array shape violation with RESHAPE despite -fbounds-check
- 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: 8 Nov 2006 20:48:49 -0000
- Subject: [Bug fortran/28849] Missed array shape violation with RESHAPE despite -fbounds-check
- References: <bug-28849-6318@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from burnus at gcc dot gnu dot org 2006-11-08 20:48 -------
> In this case neither sunf95 nor NAGf95 find the error.
This is actually wrong; both find it.
In my example the original tree looks like (shortend): foo (__result, n)
ubound.0 = (int8) *n;
S.4 = 1;
while (1)
{
if (S.4 > ubound.0) goto L.1; else (void) 0;
(*__result.0)[NON_LVALUE_EXPR <S.4> * D.1347 + D.1345] = 4.2e+1;
S.4 = S.4 + 1;
}
L.1:;
Thus one should check
"ubound.0*stride.1+offset.2 > __result->dim[0].ubound"
and
"1 *stride.1+offset.2 < __result->dim[0].lbound"
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28849