http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58410
Bug ID: 58410 Summary: Bogus uninitialized variable warning for allocatable derived type array function result Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: vladimir.fuka at gmail dot com gfortran -c -Wall -O2 uninit.f90 uninit.f90: In function ‘sub’: uninit.f90:22:0: warning: ‘new.dim[0].ubound’ may be used uninitialized in this function [-Wmaybe-uninitialized] new = fun() ^ gfortran -c -Wall -O1 uninit.f90 without warning gfortran -v Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/usr/local/gcc-4.8/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-4.8-20130509/configure --enable-languages=c,c++,fortran --with-cloog --prefix=/usr/local/gcc-4.8 Thread model: posix gcc version 4.8.1 20130509 (prerelease) (GCC)