* [Bug c++/33802] g++ says `z' is used uninitialized but this is not true
2007-10-17 18:39 [Bug c++/33802] New: g++ says `z' is used uninitialized but this is not true bagnara at cs dot unipr dot it
@ 2007-10-17 18:41 ` bagnara at cs dot unipr dot it
2007-10-17 18:46 ` pinskia at gcc dot gnu dot org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: bagnara at cs dot unipr dot it @ 2007-10-17 18:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from bagnara at cs dot unipr dot it 2007-10-17 18:40 -------
Created an attachment (id=14366)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14366&action=view)
(Big) testcase that allows to reproduce
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33802
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/33802] g++ says `z' is used uninitialized but this is not true
2007-10-17 18:39 [Bug c++/33802] New: g++ says `z' is used uninitialized but this is not true bagnara at cs dot unipr dot it
2007-10-17 18:41 ` [Bug c++/33802] " bagnara at cs dot unipr dot it
@ 2007-10-17 18:46 ` pinskia at gcc dot gnu dot org
2007-10-17 21:23 ` rguenth at gcc dot gnu dot org
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-17 18:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2007-10-17 18:46 -------
I doubt this is not an incorrect warning.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33802
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/33802] g++ says `z' is used uninitialized but this is not true
2007-10-17 18:39 [Bug c++/33802] New: g++ says `z' is used uninitialized but this is not true bagnara at cs dot unipr dot it
2007-10-17 18:41 ` [Bug c++/33802] " bagnara at cs dot unipr dot it
2007-10-17 18:46 ` pinskia at gcc dot gnu dot org
@ 2007-10-17 21:23 ` rguenth at gcc dot gnu dot org
2007-12-22 18:03 ` manu at gcc dot gnu dot org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-10-17 21:23 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rguenth at gcc dot gnu dot org 2007-10-17 21:23 -------
"I doubt this is not an incorrect warning."
what? :)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33802
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/33802] g++ says `z' is used uninitialized but this is not true
2007-10-17 18:39 [Bug c++/33802] New: g++ says `z' is used uninitialized but this is not true bagnara at cs dot unipr dot it
` (2 preceding siblings ...)
2007-10-17 21:23 ` rguenth at gcc dot gnu dot org
@ 2007-12-22 18:03 ` manu at gcc dot gnu dot org
2008-01-07 19:48 ` bagnara at cs dot unipr dot it
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-12-22 18:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from manu at gcc dot gnu dot org 2007-12-22 18:02 -------
(In reply to comment #1)
> Created an attachment (id=14366)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14366&action=view) [edit]
> (Big) testcase that allows to reproduce
>
I can't compile the testcase with cc1plus 4.3 revision 130379. I get a lot of
warnings and a few errors. Perhaps I need to include something else ?
Anyway, the relevant SSA is:
# BLOCK 195, starting at line 37941
# PRED: 194 (true)
<L168>:;
# VUSE <zD.225363_219>;
[/home/manuel/src/pr33802.C : 37941] z.1689D.225422_240 = zD.225363;
[/home/manuel/src/pr33802.C : 37941] *toD.225359_119 = z.1689D.225422_240;
[/home/manuel/src/pr33802.C : 37942] D.225423_241 = rD.225364_141;
goto <bb 213> (<L186>);
# SUCC: 213 (fallthru)
Wuninitialized cannot handle virtual operands, so it doesn't understand that z
could have been initialized. Funny enough, this is exactly the opposite of bug
179 but both SSA dumps look very similar. I really don't understand why we warn
in one case and not in the other.
By the way, what does
# VUSE <zD.225363_219>;
exactly means? I cannot find any other mention of zD.225363_219.
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-12-22 18:02:52
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33802
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/33802] g++ says `z' is used uninitialized but this is not true
2007-10-17 18:39 [Bug c++/33802] New: g++ says `z' is used uninitialized but this is not true bagnara at cs dot unipr dot it
` (3 preceding siblings ...)
2007-12-22 18:03 ` manu at gcc dot gnu dot org
@ 2008-01-07 19:48 ` bagnara at cs dot unipr dot it
2008-01-07 19:48 ` bagnara at cs dot unipr dot it
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: bagnara at cs dot unipr dot it @ 2008-01-07 19:48 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2024 bytes --]
------- Comment #6 from bagnara at cs dot unipr dot it 2008-01-07 19:30 -------
Please, forget comment #5. Let me try again.
Indeed the testcase does not compile with GCC 4.3 (while compiling perfectly
with GCC 4.0, 4.1 and 4.2). For some reason, GCC 4.3 dislikes the
implementation of the STL that is shipped with previous versions. I have thus
reconstructed the testcase by compiling the non-preprocessed sources with GCC
version 4.3.0 20071228.
Here is what happens (note that, differently from what was the case, now the
warning is give three times in a row):
$ bunzip2 bug2.cc.bz2
$ md5sum bug2.cc
63b807d5f4dc8d88c00d84a2e951f048 bug2.cc
$ g++ -W -Wall -Wno-parentheses -O2 -c bug2.cc
bug.cc: In function void
Parma_Polyhedra_Library::add_mul_assign(Parma_Polyhedra_Library::Checked_Number<T,
P>&, const Parma_Polyhedra_Library::Checked_Number<T, P>&, const
Parma_Polyhedra_Library::Checked_Number<T, P>&) [with T = long int, Policy =
Parma_Polyhedra_Library::Checked_Number_Default_Policy]:
bug.cc:3675: warning: z is used uninitialized in this function
bug.cc:3669: note: z was declared here
bug.cc: In member function Parma_Polyhedra_Library::Poly_Gen_Relation
Parma_Polyhedra_Library::Octagonal_Shape<T>::relation_with(const
Parma_Polyhedra_Library::Generator&) const [with T = __gmp_expr<__mpq_struct
[1], __mpq_struct [1]>]:
bug.cc:3669: warning: z may be used uninitialized in this function
bug.cc:3669: note: z was declared here
bug.cc:3669: warning: z may be used uninitialized in this function
bug.cc:3669: note: z was declared here
bug.cc:3669: warning: z may be used uninitialized in this function
bug.cc:3669: note: z was declared here
$ g++ --version
g++ (GCC) 4.3.0 20071228 (experimental)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33802
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/33802] g++ says `z' is used uninitialized but this is not true
2007-10-17 18:39 [Bug c++/33802] New: g++ says `z' is used uninitialized but this is not true bagnara at cs dot unipr dot it
` (4 preceding siblings ...)
2008-01-07 19:48 ` bagnara at cs dot unipr dot it
@ 2008-01-07 19:48 ` bagnara at cs dot unipr dot it
2008-01-07 19:50 ` bagnara at cs dot unipr dot it
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: bagnara at cs dot unipr dot it @ 2008-01-07 19:48 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1719 bytes --]
------- Comment #5 from bagnara at cs dot unipr dot it 2008-01-07 19:20 -------
Indeed the testcase does not compile with GCC 4.3 (while compiling perfectly
with GCC 4.0, 4.1 and 4.2). For some reason, GCC 4.3 dislikes the
implementation of the STL that is shipped with previous versions. I have thus
reconstructed the testcase by compiling the non-preprocessed sources with GCC
version 4.3.0 20071228.
Here is what happens (note that, differently from what was the case, now the
warning is give three times in a row):
$ bunzip2 bug2.cc.bz2
$ md5sum bug2.cc
63b807d5f4dc8d88c00d84a2e951f048 bug2.cc
$ g++ -W -Wall -Wno-parentheses -O2 -c bug.cc
bug.cc: In function void
Parma_Polyhedra_Library::add_mul_assign(Parma_Polyhedra_Library::Checked_Number<T,
P>&, const Parma_Polyhedra_Library::Checked_Number<T, P>&, const
Parma_Polyhedra_Library::Checked_Number<T, P>&) [with T = long int, Policy =
Parma_Polyhedra_Library::Checked_Number_Default_Policy]:
bug.cc:3675: warning: z is used uninitialized in this function
bug.cc:3669: note: z was declared here
bug.cc: In member function Parma_Polyhedra_Library::Poly_Gen_Relation
Parma_Polyhedra_Library::Octagonal_Shape<T>::relation_with(const
Parma_Polyhedra_Library::Generator&) const [with T = __gmp_expr<__mpq_struct
[1], __mpq_struct [1]>]:
bug.cc:3669: warning: z may be used uninitialized in this function
bug.cc:3669: note: z was declared here
bug.cc:3669: warning: z may be used uninitialized in this function
bug.cc:3669: note: z was declared here
bug.cc:3669: warning: z may be used uninitialized in this function
bug.cc:3669: note: z was declared here
$
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33802
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/33802] g++ says `z' is used uninitialized but this is not true
2007-10-17 18:39 [Bug c++/33802] New: g++ says `z' is used uninitialized but this is not true bagnara at cs dot unipr dot it
` (5 preceding siblings ...)
2008-01-07 19:48 ` bagnara at cs dot unipr dot it
@ 2008-01-07 19:50 ` bagnara at cs dot unipr dot it
2008-02-01 16:29 ` manu at gcc dot gnu dot org
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: bagnara at cs dot unipr dot it @ 2008-01-07 19:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from bagnara at cs dot unipr dot it 2008-01-07 19:32 -------
Created an attachment (id=14894)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14894&action=view)
New testcase showing the problem with GCC 4.3.0
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33802
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/33802] g++ says `z' is used uninitialized but this is not true
2007-10-17 18:39 [Bug c++/33802] New: g++ says `z' is used uninitialized but this is not true bagnara at cs dot unipr dot it
` (6 preceding siblings ...)
2008-01-07 19:50 ` bagnara at cs dot unipr dot it
@ 2008-02-01 16:29 ` manu at gcc dot gnu dot org
2008-02-01 16:30 ` [Bug c++/33802] bogus "is used uninitialized" (VOPs) (inlining) manu at gcc dot gnu dot org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-02-01 16:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from manu at gcc dot gnu dot org 2008-02-01 16:28 -------
(In reply to comment #6)
> Here is what happens (note that, differently from what was the case, now the
> warning is give three times in a row):
The "is used" warning is the same issue with virtual operands. The relevant
part is this:
# BLOCK 4, starting at line 3675
# PRED: 3 (true)
# LOADS: { zD.189596 }
[bug.cc : 3675] z.1883D.189607_8 = zD.189596;
[bug.cc : 3675] *toD.188165_6(D) ={v} z.1883D.189607_8;
[bug.cc : 3676] D.189608_9 = rD.189597_4;
[bug.cc : 3676] goto <bb 10>;
# SUCC: 10 (fallthru)
We see that zD.189596 has an empty definition, which is wrong since it has been
passed by reference in a previous BB. Again, it won't be fixed until we teach
Wuninitialized about VOPS.
The "may be used" warnings appear after applying inline, so we end up with
something like:
# BLOCK 25 freq:10000, starting at line 3670
# PRED: 3 [100.0%] (fallthru,exec) 6 [33.0%] (false,exec) 7 [100.0%]
(fallthru,exec) 8 [100.0%] (fallthru,exec) 12 [33.0%] (false,exec) 13
[100.0%] (fallthru,ex\
ec) 15 [69.0%] (false,exec) 16 [100.0%] (fallthru,exec) 19 [33.0%]
(false,exec) 20 [100.0%] (fallthru,exec) 22 [69.0%] (false,exec) 23 [100.0%]
(fallthru,exec) 24\
[100.0%] (fallthru,exec)
# zD.203060_41 = PHI <zD.203060_58(3), zD.203060_50(D)(6), zD.203060_51(7),
zD.203060_52(8), zD.203060_50(D)(12), zD.203060_53(13), zD.203060_50(D)(15),
zD.203060_54(\
16), zD.203060_50(D)(19), zD.203060_55(20), zD.203060_50(D)(22),
zD.203060_56(23), zD.203060_57(24)>
# D.222111_38 = PHI <4(3), 33(6), 2(7), 4(8), 33(12), 2(13), 18(15), 1(16),
33(19), 2(20), 18(22), 1(23), 4(24)>
D.222156_40 = D.222111_38;
[bug.cc : 3670] rD.203116_7 = D.222156_40;
[bug.cc : 3671] r.1882D.203125_9 = (intD.2) rD.203116_7;
[bug.cc : 3671] switch (r.1882D.203125_9)
Whether that is a correct PHI, I cannot tell because the testcase is too huge
for me to understand how that happened. Yet, we should not be warning for each
PHI operand, at a minimum.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33802
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/33802] bogus "is used uninitialized" (VOPs) (inlining)
2007-10-17 18:39 [Bug c++/33802] New: g++ says `z' is used uninitialized but this is not true bagnara at cs dot unipr dot it
` (7 preceding siblings ...)
2008-02-01 16:29 ` manu at gcc dot gnu dot org
@ 2008-02-01 16:30 ` manu at gcc dot gnu dot org
2008-02-01 16:49 ` rguenth at gcc dot gnu dot org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-02-01 16:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from manu at gcc dot gnu dot org 2008-02-01 16:29 -------
Changing subject to something more informative.
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|g++ says `z' is used |bogus "is used
|uninitialized but this is |uninitialized" (VOPs)
|not true |(inlining)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33802
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/33802] bogus "is used uninitialized" (VOPs) (inlining)
2007-10-17 18:39 [Bug c++/33802] New: g++ says `z' is used uninitialized but this is not true bagnara at cs dot unipr dot it
` (8 preceding siblings ...)
2008-02-01 16:30 ` [Bug c++/33802] bogus "is used uninitialized" (VOPs) (inlining) manu at gcc dot gnu dot org
@ 2008-02-01 16:49 ` rguenth at gcc dot gnu dot org
2008-02-01 18:16 ` manu at gcc dot gnu dot org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-01 16:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from rguenth at gcc dot gnu dot org 2008-02-01 16:48 -------
# zD.203060_41 = PHI <zD.203060_58(3), zD.203060_50(D)(6), zD.203060_51(7),
zD.203060_52(8), zD.203060_50(D)(12), zD.203060_53(13), zD.203060_50(D)(15),
zD.203060_54(\
16), zD.203060_50(D)(19), zD.203060_55(20), zD.203060_50(D)(22),
zD.203060_56(23), zD.203060_57(24)>
The PHI is correct, you get one arg per incoming edge. But yes, we should
warn only once for default definitions that appear multiple times in
single PHI nodes and also in mulitple PHI nodes. But we mark the
var with TREE_NO_WARNING, so it should not warn multiple times here.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33802
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/33802] bogus "is used uninitialized" (VOPs) (inlining)
2007-10-17 18:39 [Bug c++/33802] New: g++ says `z' is used uninitialized but this is not true bagnara at cs dot unipr dot it
` (9 preceding siblings ...)
2008-02-01 16:49 ` rguenth at gcc dot gnu dot org
@ 2008-02-01 18:16 ` manu at gcc dot gnu dot org
2008-02-01 18:21 ` manu at gcc dot gnu dot org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-02-01 18:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from manu at gcc dot gnu dot org 2008-02-01 18:16 -------
I tried to debug this but it just keep spilling gibberish, which makes it hard
to debug under emacs. Is there a commandline option to stop C++ front-end
hyper-verbose output?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33802
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/33802] bogus "is used uninitialized" (VOPs) (inlining)
2007-10-17 18:39 [Bug c++/33802] New: g++ says `z' is used uninitialized but this is not true bagnara at cs dot unipr dot it
` (10 preceding siblings ...)
2008-02-01 18:16 ` manu at gcc dot gnu dot org
@ 2008-02-01 18:21 ` manu at gcc dot gnu dot org
2008-02-04 20:38 ` manu at gcc dot gnu dot org
2008-02-04 20:40 ` manu at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-02-01 18:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from manu at gcc dot gnu dot org 2008-02-01 18:21 -------
(In reply to comment #10)
>
> The PHI is correct, you get one arg per incoming edge.
What I meant by correct is that there is some reasonable way to end up with
this PHI containing an empty definition when there is no uninitialized use of a
variable. Sorry for the confusion.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33802
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/33802] bogus "is used uninitialized" (VOPs) (inlining)
2007-10-17 18:39 [Bug c++/33802] New: g++ says `z' is used uninitialized but this is not true bagnara at cs dot unipr dot it
` (11 preceding siblings ...)
2008-02-01 18:21 ` manu at gcc dot gnu dot org
@ 2008-02-04 20:38 ` manu at gcc dot gnu dot org
2008-02-04 20:40 ` manu at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-02-04 20:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from manu at gcc dot gnu dot org 2008-02-04 20:37 -------
Created an attachment (id=15095)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15095&action=view)
Reduced testcase (16K) GCC 4.3
I can't reduce this further, so I post it here in case someone wants to give it
a try. I am just looking to fix the duplicated "may be uninitialized" warning.
This testcase won't be useful to track why there is a warning. And I don't know
how to reduce the original testcase to do that. It is too big for me to analyse
manually and automatic reduction tools will likely remove initialisations and
make the warning correct.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33802
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/33802] bogus "is used uninitialized" (VOPs) (inlining)
2007-10-17 18:39 [Bug c++/33802] New: g++ says `z' is used uninitialized but this is not true bagnara at cs dot unipr dot it
` (12 preceding siblings ...)
2008-02-04 20:38 ` manu at gcc dot gnu dot org
@ 2008-02-04 20:40 ` manu at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-02-04 20:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from manu at gcc dot gnu dot org 2008-02-04 20:39 -------
Created an attachment (id=15096)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15096&action=view)
Test for a valid testcase
This is the test I am using for reducing the testcase. If you change something
and run:
./pr33802.sh new.ii && echo OK
and don't get an OK, then the testcase is not valid anymore. Otherwise, great!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33802
^ permalink raw reply [flat|nested] 15+ messages in thread