[Patch, fortran] PR31205 - aliased operator assignment produces wrong result

FX Coudert fxcoudert@gmail.com
Sun Jul 15 00:29:00 GMT 2007


>> 2007-06-30  Paul Thomas  <pault@gcc.gnu.org>
>>
>>     PR fortran/31205
>>     * trans-expr.c (gfc_conv_function_call): Remove the default
>>     initialization of intent(out) derived types.
>>     * symbol.c (gfc_lval_expr_from_sym): New function.
>>     * matchexp.c (gfc_get_parentheses): Rsolve argument expression
>>     and return argument, if it is not numeric and posseses a ref.
>>     * gfortran.h : Add prototype for gfc_lval_expr_from_sym.
>>     * resolve.c (has_default_initializer): Move higher up in file.
>>     (resolve_code): On detecting an interface assignment, check
>>     if the rhs and the lhs are the same symbol.  If this is so,
>>     enclose the rhs in parenetheses to generate a temporary and
>>     prevent any possible aliasing.
>>     (apply_default_init): Remove code making the lval and call
>>     gfc_lval_expr_from_sym instead.
>>     * trans-decl.c (gfc_trans_deferred_vars): Apply the a default
>>     initializer, if any, to an intent(out) derived type, using
>>     gfc_lval_expr_from_sym and gfc_trans_assignment.  Check if
>>     the dummy is present.

OK

>>     * gfortran.dg/alloc_comp_basics_1.f90 : Restore number of
>>     "deallocates" to 24, since patch has code rid of much spurious
>>     code.

s/code/gotten/



More information about the Gcc-patches mailing list