http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48462
--- Comment #5 from Paul Thomas <pault at gcc dot gnu.org> 2011-04-10 18:48:40 UTC --- (In reply to comment #4) > This should be easy. The only difference between default (failing) and ....snip.... > which sort of does a job on 'a'. I say that it is easy because there are not > many sections in trans-xxx that hide behind the -frealloc-lhs condition. The problem is with trans-expr.c (realloc_lhs_bounds_for_intrinsic_call), where the result data is freed, in order to signal to the library that an allocation is needed. The easiest solution would be to use arrayfunc_assign_needs_temporary to force temporary creation, if the function is intrinsic and the lhs variable appears anywhere in the rhs. I'll put thinking hat on to see if something more elegant comes to mind. Paul