public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/31841] New: warning: 'this.0' is used uninitialized in this function
@ 2007-05-05 16:28 sylvain dot pion at sophia dot inria dot fr
2007-05-05 18:19 ` [Bug c++/31841] " rguenth at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: sylvain dot pion at sophia dot inria dot fr @ 2007-05-05 16:28 UTC (permalink / raw)
To: gcc-bugs
Compiling the code below with -O2 -Wall produces the buggy warning
mentionned in the subject.
g++ 4.1 and 4.3 do not have this problem.
The code below is pretty minimal (extracted from CGAL).
For example, removing the derivation from the Empty_class
removes the buggy warning.
----------------
struct Empty_class {};
struct C : Empty_class {};
struct M {
static C f() { return C(); }
};
struct R {
C c;
R()
: c(M::f()) {}
};
int main()
{
R r;
return 0;
}
--------------------
--
Summary: warning: 'this.0' is used uninitialized in this function
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sylvain dot pion at sophia dot inria dot fr
GCC host triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31841
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/31841] warning: 'this.0' is used uninitialized in this function
2007-05-05 16:28 [Bug c++/31841] New: warning: 'this.0' is used uninitialized in this function sylvain dot pion at sophia dot inria dot fr
@ 2007-05-05 18:19 ` rguenth at gcc dot gnu dot org
2009-02-09 16:06 ` [Bug middle-end/31841] [4.2 regression] bogus is used uninitialized (warning in dead code) manu at gcc dot gnu dot org
2009-03-30 21:47 ` jsm28 at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-05-05 18:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2007-05-05 19:19 -------
int main() ()
{
struct Empty_class * this.0;
struct Empty_class * const this;
struct C * D.2077;
struct R r;
int D.2064;
<bb 2>:
D.2077_1 = &r.c;
this.0_3 = this.0_2;
this.0_4 = (struct Empty_class *) D.2077_1;
D.2064_5 = 0;
return D.2064_5;
}
somehow inlining ends up with the unused copies.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31841
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/31841] [4.2 regression] bogus is used uninitialized (warning in dead code)
2007-05-05 16:28 [Bug c++/31841] New: warning: 'this.0' is used uninitialized in this function sylvain dot pion at sophia dot inria dot fr
2007-05-05 18:19 ` [Bug c++/31841] " rguenth at gcc dot gnu dot org
@ 2009-02-09 16:06 ` manu at gcc dot gnu dot org
2009-03-30 21:47 ` jsm28 at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: manu at gcc dot gnu dot org @ 2009-02-09 16:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from manu at gcc dot gnu dot org 2009-02-09 16:06 -------
This works in GCC 4.1, 4.3 and 4.4, so this is either a regression (that
probably will not be fixed before 4.2 is closed) or it is not a regression and
should be closed as FIXED already in trunk.
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu dot org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-02-09 16:06:14
date| |
Summary|warning: 'this.0' is used |[4.2 regression] bogus is
|uninitialized in this |used uninitialized (warning
|function (warning in dead |in dead code)
|code) |
Target Milestone|--- |4.2.6
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31841
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/31841] [4.2 regression] bogus is used uninitialized (warning in dead code)
2007-05-05 16:28 [Bug c++/31841] New: warning: 'this.0' is used uninitialized in this function sylvain dot pion at sophia dot inria dot fr
2007-05-05 18:19 ` [Bug c++/31841] " rguenth at gcc dot gnu dot org
2009-02-09 16:06 ` [Bug middle-end/31841] [4.2 regression] bogus is used uninitialized (warning in dead code) manu at gcc dot gnu dot org
@ 2009-03-30 21:47 ` jsm28 at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-30 21:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jsm28 at gcc dot gnu dot org 2009-03-30 21:46 -------
Closing 4.2 branch, fixed in 4.3.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Known to fail|4.2.3 |4.2.3 4.2.5
Resolution| |FIXED
Target Milestone|4.2.6 |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31841
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-03-30 21:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-05 16:28 [Bug c++/31841] New: warning: 'this.0' is used uninitialized in this function sylvain dot pion at sophia dot inria dot fr
2007-05-05 18:19 ` [Bug c++/31841] " rguenth at gcc dot gnu dot org
2009-02-09 16:06 ` [Bug middle-end/31841] [4.2 regression] bogus is used uninitialized (warning in dead code) manu at gcc dot gnu dot org
2009-03-30 21:47 ` jsm28 at gcc dot gnu dot 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).