https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98433
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code --- Comment #8 from anlauf at gcc dot gnu.org --- We are now generating a shallow copy instead of a deep copy for the line: x3 = merge(x1, x2, .false.) This gives: { struct t D.4345; struct t D.4346; struct t D.4347; D.4345 = x1; D.4346 = x2; D.4347 = x3; x3 = D.4346; if ((real(kind=4)[0:] * restrict) D.4347.v.data != 0B) { __builtin_free ((void *) D.4347.v.data); (real(kind=4)[0:] * restrict) D.4347.v.data = 0B; } } while e.g. the assignment x3 = x2 produces: ... x3 = x2; if ((void *) x2.v.data != 0B) { D.4346 = (x2.v.dim[0].ubound - x2.v.dim[0].lbound) + 1; D.4347 = NON_LVALUE_EXPR <D.4346>; D.4348 = (void * restrict) __builtin_malloc (MAX_EXPR <(unsigned long) (D.4347 * 4), 1>); x3.v.data = D.4348; __builtin_memcpy ((real(kind=4)[0:] * restrict) x3.v.data, (real(kind=4)[0:] * restrict) x2.v.data, (unsigned long) (D.4347 * 4)); } else { x3.v.data = 0B; } ...