This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/45828] [4.6 Regression] No default initialization of derived type members?
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 29 Sep 2010 13:01:54 +0000
- Subject: [Bug fortran/45828] [4.6 Regression] No default initialization of derived type members?
- Auto-submitted: auto-generated
- References: <bug-45828-4@http.gcc.gnu.org/bugzilla/>
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.