[Patch, fortran] PR34438 - gfortran not compliant w.r.t default initialization of derived type component and implicit SAVE attribute

Paul Richard Thomas paul.richard.thomas@gmail.com
Mon Dec 17 19:58:00 GMT 2007


:ADDPATCH fortran:

This patch is described by the ChangeLogs and the comments in the
text.  The problem is that default initializers at present force the
variable to be TREE_STATIC or SAVED.  Thus they are only initialized
once during the execution of a program.  The standard requires that
they be initialized every time they come into scope.  This is
accomplished by building an lvalue expression from the symbol and
deploying gfc_trans_assignment with the 'value' expression as the
lvalue.

The testcase contains, more or less, the two provided by the reporter.

Bootstrapped and regtested on x86_ia64/FC5  - OK for trunk?

Paul

-- 
The knack of flying is learning how to throw yourself at the ground and miss.
       --Hitchhikers Guide to the Galaxy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: commit.msg
Type: application/octet-stream
Size: 577 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20071217/7ed92bbc/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: submit.diff
Type: text/x-patch
Size: 7624 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20071217/7ed92bbc/attachment.bin>


More information about the Gcc-patches mailing list