public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49523] New: uninitialized warning present when compiled with O1 but not with O0
@ 2011-06-24 19:52 pascal22p at parois dot net
  2011-06-24 22:29 ` [Bug fortran/49523] " steven at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: pascal22p at parois dot net @ 2011-06-24 19:52 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug fortran/49523] uninitialized warning present when compiled with O1 but not with O0
  2011-06-24 19:52 [Bug fortran/49523] New: uninitialized warning present when compiled with O1 but not with O0 pascal22p at parois dot net
@ 2011-06-24 22:29 ` steven at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: steven at gcc dot gnu.org @ 2011-06-24 22:29 UTC (permalink / raw)
  To: gcc-bugs

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

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |steven at gcc dot gnu.org
         Resolution|                            |INVALID

--- Comment #1 from Steven Bosscher <steven at gcc dot gnu.org> 2011-06-24 22:28:31 UTC ---
From
http://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Warning-Options.html#index-Wuninitialized-326

"Because these warnings depend on optimization, the exact variables or elements
for which there are warnings will depend on the precise optimization options
and version of GCC used."


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-24 22:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-24 19:52 [Bug fortran/49523] New: uninitialized warning present when compiled with O1 but not with O0 pascal22p at parois dot net
2011-06-24 22:29 ` [Bug fortran/49523] " steven at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).