http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43366
--- Comment #9 from Paul Thomas <pault at gcc dot gnu.org> 2011-02-04 09:32:01 UTC --- (In reply to comment #5) > Realloc-on-assign for scalars was implemented in r169356. > > Paul, what does it take to make this work for polymorphic scalars? Not a lot, I think. If you take a look in gfc_trans_allocate, there is a bit that I think that you must have written, which initialises CLASS variables. I would have thought that this can be lifted and deposited wholesale in trans_assignment1 and gfc_trans_allocate reconfigured to use the assignement. I am taking a look at gfc_trans_allocate this lunchtime; there's something not quite right structurally with it. I attempted to add a patch of code to have a single evaluation of the SOURCE expression and wound up displacing unrelated declarations, when I added the se.post to the end of the main block. gimple did not like it at all :-( I'll come back to you. Cheers Paul