------- Comment #1 from burnus at gcc dot gnu dot org  2010-02-25 23:51 -------
Created an attachment (id=19962)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19962&action=view)
Draft patch - regtests, but needs some audit

The attached patch drastically reduces the generated code
(-fdump-tree-original) for initializations.
a) For variables in PROGRAM which are static (note: variables in PROGRAM are
implicitly SAVE).
b) For all kind of derived types with default initializer, especially those
which have allocatable components

I am quite confident that the code is correct, however, one should check
whether the "dealloc" argument is correct. If it is wrong, there will be either
unnecessarily a  if(var != NULL) { free }  or the program will leak memory.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43178

Reply via email to