This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/47307] Uninitialized in this function: warning for initialized, no warning for uninitialized
- 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: Sat, 15 Jan 2011 16:22:39 +0000
- Subject: [Bug middle-end/47307] Uninitialized in this function: warning for initialized, no warning for uninitialized
- Auto-submitted: auto-generated
- References: <bug-47307-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47307
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
CC| |burnus at gcc dot gnu.org
Component|fortran |middle-end
Summary|be used uninitialized in |Uninitialized in this
|this function |function: warning for
| |initialized, no warning for
| |uninitialized
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-15 16:22:27 UTC ---
Move to middle end. From the dump:
readmo ()
{
integer(kind=4) lopt[15];
real(kind=4) convrt;
[...]
iflag = 0;
[...]
if (lopt[((integer(kind=8)) j + (integer(kind=8)) i * 3) + -4] < 0)
{
convrt = 1.0e+0;
iflag = 1;
}
if (iflag != 0)
... access convrt ...
Thus, lopt is never set, but not warned for. But convrt is only accessed if it
is set. However, the middle-end (with optimization) only has
warning: 'convrt' may be used uninitialized in this function