[Bug fortran/36192] ICE with wrong index types and bad parens
kargl at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Dec 30 00:34:00 GMT 2009
------- Comment #10 from kargl at gcc dot gnu dot org 2009-12-30 00:33 -------
(In reply to comment #9)
> Some addition information from valgrind.
>
> Error: Different shape for array assignment at (1) on dimension 1 (0 and 2)
> ==13911== Invalid read of size 8
> ==13911== at 0x1C108F8: __gmpz_get_si (in /usr/local/lib/libgmp.so.8)
> ==13911== by 0x4B426F: compare_actual_formal (interface.c:1704)
The order code is invalid code to say the least. However, in interface.c
we end up at
for (i = 0; i < ref->u.ar.as->rank; i++)
{
if (ref->u.ar.as->lower[i] && ref->u.ar.as->upper[i]
&& ref->u.ar.as->lower[i]->expr_type == EXPR_CONSTANT
&& ref->u.ar.as->upper[i]->expr_type == EXPR_CONSTANT)
elements *= mpz_get_si (ref->u.ar.as->upper[i]->value.integer)
- mpz_get_si (ref->u.ar.as->lower[i]->value.integer)
+ 1L;
else
The segfault occurs because ref->u.ar.as->upper[i]->expr->ts.type is BT_REAL.
Somewhere up the call chain, gfortran is not checking that array
bounds are integers.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36192
More information about the Gcc-bugs
mailing list