[Bug fortran/45586] [4.8 Regression] ICE non-trivial conversion at assignment
mikael at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Aug 1 12:39:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45586
--- Comment #77 from Mikael Morin <mikael at gcc dot gnu.org> 2012-08-01 12:37:45 UTC ---
(In reply to comment #75)
> Created attachment 27919 [details]
> rough patch
>
About the patch:
The failures are mostly(all?) due to structure constructors.
Structure constructors use components' backend_decl which are of restricted
types.
however, if the lhs is a target, one should use the non-restricted components.
I tried fixing the constructor using gfc_convert (see the patch).
However, it doesn't work with scalarization, as the constructor is evaluated
outside the loop into a variable (which gets the restricted type).
So, this patch adds a flag restricted to gfc_conv_structure.
the flag propagates to gfc_conv_expr, and gfc_conv_initializer,
gfc_conv_initializer, etc.
To know whether we need to call gfc_conv_expr with the restricted flag set or
not in the scalarizer, a new flag field is added to the scalarizer's
gfc_ss_info structures to tell whether we want a non-restricted expression. For
it to be set appropriately, a flag is propagated to the gfc_walk_* functions.
More information about the Gcc-bugs
mailing list