This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/45828] [4.6 Regression] No default initialization of derived type members?


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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org,
                   |                            |janus at gcc dot gnu.org

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-09-29 13:01:54 UTC ---
With 4.3.2 I see after the malloc a loop which intializes the just allocated
array with the default initializer. Using 4.6.0 the array is allocated (malloc)
but no initialization loop is produced.

Extended test case:
  type(a), target :: initVal
  type b
    type(a), pointer :: a => null()
    type(a), pointer :: b => initVal
    integer, pointer :: c => null()
  end type b

If "c" is pointer default initialized, every thing works. But if a derived-type
component is pointer initialized (with NULL or with a target), no such
temporary is generated.

I wonder whether some check for BT_CLASS gets wrongly applied to BT_TYPE.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]