[Bug fortran/48462] [4.6/4.7 Regression] realloc on assignment: matmul Segmentation Fault with Allocatable Array
pault at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Apr 10 18:49:00 GMT 2011
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
More information about the Gcc-bugs
mailing list