public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/19510] New: [4.0 regression] Warning using list iterators
@ 2005-01-18 20:12 reichelt at gcc dot gnu dot org
2005-01-18 20:20 ` [Bug libstdc++/19510] " pinskia at gcc dot gnu dot org
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-01-18 20:12 UTC (permalink / raw)
To: gcc-bugs
Compiling the following code snippet with "-Wall -O3" using mainline
===============================================
#include<vector>
#include<list>
std::vector<std::list<int>::iterator> v(1);
===============================================
I get the following warning:
/long_path/stl_construct.h: In function 'void
__static_initialization_and_destruction_0(int, int)':
/long_path/stl_construct.h:81: warning: 'SR.133' is used uninitialized in this
function
Apart from the strange variable name 'SR.133' the warning seems to be
justified as the default constructor of _List_iterator does not initialize
the pointer _M_node. _List_const_iterator has the same problem.
The following patch fixes the problem for me.
I haven't done bootstrapping and regtesting, though.
===================================================================
--- libstdc++-v3/include/bits/stl_list.h 19 Nov 2004 12:44:09 -0000 1.45
+++ libstdc++-v3/include/bits/stl_list.h 18 Jan 2005 18:49:06 -0000
@@ -119,7 +119,8 @@ namespace _GLIBCXX_STD
typedef _Tp* pointer;
typedef _Tp& reference;
- _List_iterator() { }
+ _List_iterator()
+ : _M_node() { }
_List_iterator(_List_node_base* __x)
: _M_node(__x) { }
@@ -195,7 +196,8 @@ namespace _GLIBCXX_STD
typedef const _Tp* pointer;
typedef const _Tp& reference;
- _List_const_iterator() { }
+ _List_const_iterator()
+ : _M_node() { }
_List_const_iterator(const _List_node_base* __x)
: _M_node(__x) { }
===================================================================
--
Summary: [4.0 regression] Warning using list iterators
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19510
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libstdc++/19510] [4.0 regression] Warning using list iterators
2005-01-18 20:12 [Bug libstdc++/19510] New: [4.0 regression] Warning using list iterators reichelt at gcc dot gnu dot org
@ 2005-01-18 20:20 ` pinskia at gcc dot gnu dot org
2005-01-18 21:02 ` gdr at integrable-solutions dot net
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-18 20:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-18 20:20 -------
Confirmed, the diagnostic problem I think is already filed in a different bug.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-01-18 20:20:05
date| |
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19510
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libstdc++/19510] [4.0 regression] Warning using list iterators
2005-01-18 20:12 [Bug libstdc++/19510] New: [4.0 regression] Warning using list iterators reichelt at gcc dot gnu dot org
2005-01-18 20:20 ` [Bug libstdc++/19510] " pinskia at gcc dot gnu dot org
@ 2005-01-18 21:02 ` gdr at integrable-solutions dot net
2005-01-18 21:10 ` pcarlini at suse dot de
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-01-18 21:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at integrable-solutions dot net 2005-01-18 21:02 -------
Subject: Re: New: [4.0 regression] Warning using list iterators
"reichelt at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| Compiling the following code snippet with "-Wall -O3" using mainline
|
| ===============================================
| #include<vector>
| #include<list>
|
| std::vector<std::list<int>::iterator> v(1);
| ===============================================
|
| I get the following warning:
|
| /long_path/stl_construct.h: In function 'void
| __static_initialization_and_destruction_0(int, int)':
| /long_path/stl_construct.h:81: warning: 'SR.133' is used uninitialized in this
| function
|
| Apart from the strange variable name 'SR.133' the warning seems to be
| justified as the default constructor of _List_iterator does not initialize
| the pointer _M_node. _List_const_iterator has the same problem.
That strange warning would be greatly useful if SRA names were not
used. They make the diagnostic rather cryptic and noisy.
I think your patch is OK and should be applied.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19510
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libstdc++/19510] [4.0 regression] Warning using list iterators
2005-01-18 20:12 [Bug libstdc++/19510] New: [4.0 regression] Warning using list iterators reichelt at gcc dot gnu dot org
2005-01-18 20:20 ` [Bug libstdc++/19510] " pinskia at gcc dot gnu dot org
2005-01-18 21:02 ` gdr at integrable-solutions dot net
@ 2005-01-18 21:10 ` pcarlini at suse dot de
2005-01-18 21:46 ` gdr at integrable-solutions dot net
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pcarlini at suse dot de @ 2005-01-18 21:10 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2005-01-18 21:10 -------
> I think your patch is OK and should be applied.
First blush, I agree. Is it 100% safe wrt the ABI? (I remember tricky details
only about copy constructor and assignment, actually)
In case, please fix also occurrences in stl_tree.h: this issue comes from the
original HP/SGI code...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19510
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libstdc++/19510] [4.0 regression] Warning using list iterators
2005-01-18 20:12 [Bug libstdc++/19510] New: [4.0 regression] Warning using list iterators reichelt at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-01-18 21:10 ` pcarlini at suse dot de
@ 2005-01-18 21:46 ` gdr at integrable-solutions dot net
2005-01-18 21:50 ` pcarlini at suse dot de
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-01-18 21:46 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at integrable-solutions dot net 2005-01-18 21:46 -------
Subject: Re: [4.0 regression] Warning using list iterators
"pcarlini at suse dot de" <gcc-bugzilla@gcc.gnu.org> writes:
| > I think your patch is OK and should be applied.
|
| First blush, I agree. Is it 100% safe wrt the ABI? (I remember tricky details
| only about copy constructor and assignment, actually)
Careless addition of constructors or destructors can indeed change an ABI.
However in the specific case at hand, the addition is that of a
non-copy default constructor whose only potential impact is that
of changing a POD to non-POD. However, both _List_iterator and
_List_const_iterator are already non-POD as they have a constructor to
convert from a _List_node_base*.
So the patch is ABI-neutral.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19510
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libstdc++/19510] [4.0 regression] Warning using list iterators
2005-01-18 20:12 [Bug libstdc++/19510] New: [4.0 regression] Warning using list iterators reichelt at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-01-18 21:46 ` gdr at integrable-solutions dot net
@ 2005-01-18 21:50 ` pcarlini at suse dot de
2005-01-20 1:48 ` reichelt at gcc dot gnu dot org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pcarlini at suse dot de @ 2005-01-18 21:50 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2005-01-18 21:50 -------
> So the patch is ABI-neutral.
Great! (many thanks for the interesting explanation, Gaby)
Therefore, if Volker is willing to regtest the complete fix and post it...
P.S. Too bad that only -O3 triggers the warning.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19510
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libstdc++/19510] [4.0 regression] Warning using list iterators
2005-01-18 20:12 [Bug libstdc++/19510] New: [4.0 regression] Warning using list iterators reichelt at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-01-18 21:50 ` pcarlini at suse dot de
@ 2005-01-20 1:48 ` reichelt at gcc dot gnu dot org
2005-01-21 1:23 ` cvs-commit at gcc dot gnu dot org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-01-20 1:48 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-01-20 01:47 -------
Patch here:
http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01280.html
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |reichelt at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Keywords| |monitored, patch
Last reconfirmed|2005-01-18 20:20:05 |2005-01-20 01:47:54
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19510
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libstdc++/19510] [4.0 regression] Warning using list iterators
2005-01-18 20:12 [Bug libstdc++/19510] New: [4.0 regression] Warning using list iterators reichelt at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-01-20 1:48 ` reichelt at gcc dot gnu dot org
@ 2005-01-21 1:23 ` cvs-commit at gcc dot gnu dot org
2005-01-21 1:27 ` [Bug libstdc++/19510] Uninitialized pointers in iterators reichelt at gcc dot gnu dot org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-21 1:23 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-01-21 01:23 -------
Subject: Bug 19510
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: reichelt@gcc.gnu.org 2005-01-21 01:23:28
Modified files:
libstdc++-v3 : ChangeLog
libstdc++-v3/include/bits: stl_list.h stl_tree.h
libstdc++-v3/testsuite/23_containers/map/operators: 1_neg.cc
libstdc++-v3/testsuite/23_containers/set/operators: 1_neg.cc
Log message:
PR libstdc++/19510
* include/bits/stl_list.h (_List_iterator): Initialize _M_node
in constructor.
(_List_const_iterator): Likewise.
* include/bits/stl_tree.h (_Rb_tree_iterator): Likewise.
(_Rb_tree_const_iterator): Likewise.
* testsuite/23_containers/map/operators/1_neg.cc: Adjust line numbers.
* testsuite/23_containers/set/operators/1_neg.cc: Likewise.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2865&r2=1.2866
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_list.h.diff?cvsroot=gcc&r1=1.45&r2=1.46
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_tree.h.diff?cvsroot=gcc&r1=1.42&r2=1.43
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/23_containers/map/operators/1_neg.cc.diff?cvsroot=gcc&r1=1.5&r2=1.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/23_containers/set/operators/1_neg.cc.diff?cvsroot=gcc&r1=1.5&r2=1.6
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19510
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libstdc++/19510] Uninitialized pointers in iterators
2005-01-18 20:12 [Bug libstdc++/19510] New: [4.0 regression] Warning using list iterators reichelt at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-01-21 1:23 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-21 1:27 ` reichelt at gcc dot gnu dot org
2005-01-21 16:22 ` [Bug libstdc++/19510] [3.4 only] " cvs-commit at gcc dot gnu dot org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-01-21 1:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-01-21 01:26 -------
We still have uninitialized pointers in the 3.4 and 3.3 branch.
Patches in preparation.
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.0 regression] Warning |Uninitialized pointers in
|using list iterators |iterators
Target Milestone|4.0.0 |3.4.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19510
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libstdc++/19510] [3.4 only] Uninitialized pointers in iterators
2005-01-18 20:12 [Bug libstdc++/19510] New: [4.0 regression] Warning using list iterators reichelt at gcc dot gnu dot org
` (7 preceding siblings ...)
2005-01-21 1:27 ` [Bug libstdc++/19510] Uninitialized pointers in iterators reichelt at gcc dot gnu dot org
@ 2005-01-21 16:22 ` cvs-commit at gcc dot gnu dot org
2005-01-21 16:25 ` [Bug libstdc++/19510] [3.3 " reichelt at gcc dot gnu dot org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-21 16:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-01-21 16:22 -------
Subject: Bug 19510
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_4-branch
Changes by: reichelt@gcc.gnu.org 2005-01-21 16:21:40
Modified files:
libstdc++-v3 : ChangeLog
libstdc++-v3/include/bits: stl_list.h stl_tree.h
libstdc++-v3/testsuite/23_containers/map/operators: 1_neg.cc
libstdc++-v3/testsuite/23_containers/set/operators: 1_neg.cc
Log message:
PR libstdc++/19510
* include/bits/stl_list.h (_List_iterator): Initialize _M_node
in constructor.
(_List_const_iterator): Likewise.
* include/bits/stl_tree.h (_Rb_tree_iterator): Likewise.
(_Rb_tree_const_iterator): Likewise.
* testsuite/23_containers/map/operators/1_neg.cc: Adjust line numbers.
* testsuite/23_containers/set/operators/1_neg.cc: Likewise.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2224.2.210&r2=1.2224.2.211
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_list.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.34.4.4&r2=1.34.4.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_tree.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.30.4.4&r2=1.30.4.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/23_containers/map/operators/1_neg.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3.4.1&r2=1.3.4.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/23_containers/set/operators/1_neg.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3.4.1&r2=1.3.4.2
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19510
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libstdc++/19510] [3.3 only] Uninitialized pointers in iterators
2005-01-18 20:12 [Bug libstdc++/19510] New: [4.0 regression] Warning using list iterators reichelt at gcc dot gnu dot org
` (8 preceding siblings ...)
2005-01-21 16:22 ` [Bug libstdc++/19510] [3.4 only] " cvs-commit at gcc dot gnu dot org
@ 2005-01-21 16:25 ` reichelt at gcc dot gnu dot org
2005-01-21 23:53 ` cvs-commit at gcc dot gnu dot org
2005-01-21 23:54 ` reichelt at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-01-21 16:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-01-21 16:23 -------
Regtesting patch for 3.3 branch.
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords|diagnostic, monitored |
Summary|[3.4 only] Uninitialized |[3.3 only] Uninitialized
|pointers in iterators |pointers in iterators
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19510
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libstdc++/19510] [3.3 only] Uninitialized pointers in iterators
2005-01-18 20:12 [Bug libstdc++/19510] New: [4.0 regression] Warning using list iterators reichelt at gcc dot gnu dot org
` (9 preceding siblings ...)
2005-01-21 16:25 ` [Bug libstdc++/19510] [3.3 " reichelt at gcc dot gnu dot org
@ 2005-01-21 23:53 ` cvs-commit at gcc dot gnu dot org
2005-01-21 23:54 ` reichelt at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-21 23:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-01-21 23:53 -------
Subject: Bug 19510
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_3-branch
Changes by: reichelt@gcc.gnu.org 2005-01-21 23:52:49
Modified files:
libstdc++-v3 : ChangeLog
libstdc++-v3/include/bits: stl_list.h stl_tree.h
Log message:
PR libstdc++/19510
* include/bits/stl_list.h (_List_iterator_base): Initialize _M_node
in constructor.
(_List_iterator): Initialize _List_iterator_base in constructor.
* include/bits/stl_tree.h (_Rb_tree_iterator): Initialize _M_node
in constructor.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.1464.2.194&r2=1.1464.2.195
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_list.h.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.20&r2=1.20.8.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_tree.h.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.17&r2=1.17.2.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19510
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug libstdc++/19510] [3.3 only] Uninitialized pointers in iterators
2005-01-18 20:12 [Bug libstdc++/19510] New: [4.0 regression] Warning using list iterators reichelt at gcc dot gnu dot org
` (10 preceding siblings ...)
2005-01-21 23:53 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-21 23:54 ` reichelt at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-01-21 23:54 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-01-21 23:54 -------
Fixed in gcc 3.3.6, 3.4.4, and mainline.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|3.4.4 |3.3.6
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19510
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2005-01-21 23:54 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-18 20:12 [Bug libstdc++/19510] New: [4.0 regression] Warning using list iterators reichelt at gcc dot gnu dot org
2005-01-18 20:20 ` [Bug libstdc++/19510] " pinskia at gcc dot gnu dot org
2005-01-18 21:02 ` gdr at integrable-solutions dot net
2005-01-18 21:10 ` pcarlini at suse dot de
2005-01-18 21:46 ` gdr at integrable-solutions dot net
2005-01-18 21:50 ` pcarlini at suse dot de
2005-01-20 1:48 ` reichelt at gcc dot gnu dot org
2005-01-21 1:23 ` cvs-commit at gcc dot gnu dot org
2005-01-21 1:27 ` [Bug libstdc++/19510] Uninitialized pointers in iterators reichelt at gcc dot gnu dot org
2005-01-21 16:22 ` [Bug libstdc++/19510] [3.4 only] " cvs-commit at gcc dot gnu dot org
2005-01-21 16:25 ` [Bug libstdc++/19510] [3.3 " reichelt at gcc dot gnu dot org
2005-01-21 23:53 ` cvs-commit at gcc dot gnu dot org
2005-01-21 23:54 ` reichelt 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).