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/49523] New: uninitialized warning present when compiled with O1 but not with O0


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

           Summary: uninitialized warning present when compiled with O1
                    but not with O0
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pascal22p@parois.net


Created attachment 24593
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24593
file showing the issue

There are many other similar bugs so it might be related to an existing one.
Sorry about that.

I have a different behaviour depending of level optimisation. A warning is
issued using O1, O2, O3, Os but not with O0.

Compilation with -O1 gives a warning 
gfortran  -O1 -xf95-cpp-input -Wuninitialized  -c modules/matfile.f90 -o
modules/matfile.o
modules/matfile.f90: In function âsolveconstraintmatrixâ:
modules/matfile.f90:76:0: attention : âconstraintsv.offsetâ may be used
uninitialized in this function [-Wuninitialized]
modules/matfile.f90:76:0: attention : âconstraintsv.dim[1].strideâ may be used
uninitialized in this function [-Wuninitialized]
modules/matfile.f90:341:0: attention : âconstraintsv.dim[0].uboundâ may be used
uninitialized in this function [-Wuninitialized]
modules/matfile.f90:76:0: attention : âconstraints.offsetâ may be used
uninitialized in this function [-Wuninitialized]
modules/matfile.f90:405:0: attention : âconstraints.dim[1].strideâ may be used
uninitialized in this function [-Wuninitialized]
modules/matfile.f90:405:0: attention : âconstraints.dim[1].uboundâ may be used
uninitialized in this function [-Wuninitialized]
modules/matfile.f90:360:0: attention : âconstraints.dim[0].uboundâ may be used
uninitialized in this function [-Wuninitialized]

whereas no warning with O0
gfortran  -O0 -xf95-cpp-input -Wuninitialized  -c modules/matfile.f90 -o
modules/matfile.o

gcc -v
Utilisation des specs internes.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper
Target: i686-pc-linux-gnu
Configurà avec: /build/src/gcc-4.6-20110603/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --enable-gnu-unique-object
--enable-linker-build-id --with-ppl --enable-cloog-backend=isl --enable-lto
--enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold
--disable-multilib --disable-libstdcxx-pch --enable-checking=release
ModÃle de thread: posix
gcc version 4.6.0 20110603 (prerelease) (GCC) 


The source code is attached, however it is not minimal.


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