--- Comment #2 from fxcoudert at gcc dot gnu dot org 2007-03-16 15:25
---
Forgot to say: the original tree dump is
f (__result, .__result, k)
{
(void) 0;
MAIN__ ()
{
static void f (char[1:] , int4, int4 );
_gfortran_set_std (68, 127, 0);
{
void * D.1377;
void * D.1374;
struct array1_unknown atmp.3;
void * D.1367;
struct array1_unknown atmp.0;
atmp.0.dtype = (SAVE_EXPR (unnamed type) (..__result + -1) + 1 6) +
49;
atmp.0.dim[0].stride = 1;
atmp.0.dim[0].lbound = 0;
atmp.0.dim[0].ubound = 0;
D.1367 = _gfortran_internal_malloc64 ((int8) (SAVE_EXPR (unnamed type)
(..__result + -1) + 1));
atmp.0.data = D.1367;
atmp.0.offset = 0;
{
char[1:D.1371] * pstr.2;
int4 D.1371;
int4 * D.1370;
static int4 C.1369 = 1;
D.1370 = C.1369;
D.1371 = *D.1370;
pstr.2 = (char[1:D.1371] *) _gfortran_internal_malloc (D.1371);
f (pstr.2, D.1371, D.1370);
__builtin_memcpy ((*(char[0:][1:..__result] *) atmp.0.data)[0], pstr.2,
D.1371);
_gfortran_internal_free ((void *) pstr.2);
}
atmp.3.dtype = (SAVE_EXPR (unnamed type) (..__result + -1) + 1 6) +
49;
atmp.3.dim[0].stride = 1;
atmp.3.dim[0].lbound = 0;
atmp.3.dim[0].ubound = 0;
D.1374 = _gfortran_internal_malloc64 ((int8) (SAVE_EXPR (unnamed type)
(..__result + -1) + 1));
atmp.3.data = D.1374;
atmp.3.offset = 0;
{
int8 S.4;
S.4 = 0;
while (1)
{
if (S.4 0) goto L.1;
(*(char[0:][1:..__result] *) atmp.3.data)[S.4] =
(*(char[0:][1:..__result] *) atmp.0.data)[S.4];
S.4 = S.4 + 1;
}
L.1:;
}
D.1377 = _gfortran_internal_pack (atmp.3);
gee (D.1377, ..__result);
if (D.1377 != (char[0:][1:..__result] *) atmp.3.data)
{
_gfortran_internal_unpack (atmp.3, D.1377);
_gfortran_internal_free (D.1377);
}
_gfortran_internal_free (atmp.0.data);
_gfortran_internal_free (atmp.3.data);
}
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31219