It's a gfortran bug that can be ignored (unless one of the participants here
wants to fix it).
If one is leary of ignoring such a dire warning, then add -fno-realloc-lhs to you
command line or allocate the array to zero size before using it on the left hand
side.
If one is interested in the internal add -fdump-tree-original to your command
line and look at the dump file. Remove a bunch for clutter, you have
void MAIN__ ()
{
struct array02_real(kind=8) a;
a.data = 0B;
The above is an unallocated array.
{
D.4265 = a.offset;
D.4266 = a.dim[0].lbound;
D.4267 = a.dim[0].ubound;
D.4268 = a.dim[1].lbound;
D.4269 = a.dim[1].ubound;
The above is what is causing the warning as
do the following two lines, which are irrelevant
because ...
D.4270 = NON_LVALUE_EXPR <D.4266>;
D.4271 = NON_LVALUE_EXPR <D.4268>;
D.4273 = &C.4272;
D.4274 = *D.4273;
D.4275 = (integer(kind=8)) D.4274 + -1;
D.4276 = *D.4273;
D.4277 = (integer(kind=8)) D.4276 + -1;
{
D.4280 = (real(kind=8)[0:] * restrict) a.data == 0B;
... this line sets D.4280 to true and the first if () ...
if (D.4280) goto L.5;
if (a.dim[0].lbound + NON_LVALUE_EXPR <D.4275> != a.dim[0].ubound) goto L.5;
if (a.dim[1].lbound + NON_LVALUE_EXPR <D.4277> != a.dim[1].ubound) goto L.5;
goto L.6;
L.5:;
if (D.4280)
{
D.4281 = 0;
... gets you here and ...
}
else
{
D.4281 = (MAX_EXPR <a.dim[0].ubound - a.dim[0].lbound, -1> + 1) * (MAX_EXPR <a.dim[1].ubound - a.dim[1].lbound, -1> + 1);
}
allows gfortran to set the right dope vector here ...
D.4282 = (NON_LVALUE_EXPR <D.4277> + 1) * (NON_LVALUE_EXPR <D.4275> + 1);
D.4283 = D.4281 != D.4282;
a.dim[0].lbound = 1;
a.dim[0].ubound = NON_LVALUE_EXPR <D.4275> + 1;
a.dim[0].stride = 1;
a.dim[1].lbound = 1;
a.dim[1].ubound = NON_LVALUE_EXPR <D.4277> + 1;
a.dim[1].stride = NON_LVALUE_EXPR <D.4275> + 1;
a.offset = -NON_LVALUE_EXPR <a.dim[0].lbound> - a.dim[1].lbound * (NON_LVALUE_EXPR <D.4275> + 1);
D.4265 = a.offset;
D.4270 = NON_LVALUE_EXPR <a.dim[0].lbound>;
D.4271 = NON_LVALUE_EXPR <a.dim[1].lbound>;
a.span = 8;
D.4284 = MAX_EXPR <(unsigned long) (D.4282 * 8), 1>;
if (D.4280)
{
and finally you allocate the memory.
a.data = (void * restrict) __builtin_malloc (D.4284);
a.dtype = {.elem_len=8, .rank=2, .type=3};
}
else
{
if (D.4283)
{
a.data = (void * restrict) __builtin_realloc ((void *) a.data, D.4284);
}
}
D.4264 = (real(kind=8)[0:] * restrict) a.data;
L.6:;
}
identity (&a, D.4273);
}
}
--
steve