public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18370] New: cp_parser_initializer_list uninit variable problems
@ 2004-11-08  8:38 dcb314 at hotmail dot com
  2004-11-08 12:38 ` [Bug c++/18370] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: dcb314 at hotmail dot com @ 2004-11-08  8:38 UTC (permalink / raw)
  To: gcc-bugs

I just tried to compile this code on a i686 Linux box with valgrind 2.2

int p1[ 10 ] =
{
	0, 0, 0, 0, 2, 0, 2, 0, 2, 3,
};

The compiler said
[dcb@localhost src]$ ~/valgrind/results.220/bin/valgrind --tool=memcheck
--trace-children=yes -q ~/gnu/gcc343/results/bin/g++  -Wno-deprecated -c
gcc343bug.cc
==30646== Conditional jump or move depends on uninitialised value(s)
==30646==    at 0x80E6AF0: cp_parser_initializer_list (parser.c:11646)
==30646==    by 0x80E69A1: cp_parser_initializer_clause (parser.c:11581)
==30646==    by 0x80F058B: cp_parser_init_declarator (parser.c:11486)
==30646==    by 0x80EAC01: cp_parser_simple_declaration (parser.c:6524)
[dcb@localhost src]$

The compiler source code is

      initializer = cp_parser_initializer_clause (parser,
                          &clause_non_constant_p);
      if (clause_non_constant_p)

Suggest that variable clause_non_constant_p hasn't been initialised 
by routine cp_parser_initializer_clause.

-- 
           Summary: cp_parser_initializer_list uninit variable problems
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dcb314 at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-linux-pc-gnu


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


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

* [Bug c++/18370] cp_parser_initializer_list uninit variable problems
  2004-11-08  8:38 [Bug c++/18370] New: cp_parser_initializer_list uninit variable problems dcb314 at hotmail dot com
@ 2004-11-08 12:38 ` pinskia at gcc dot gnu dot org
  2004-11-08 17:41 ` dcb314 at hotmail dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-08 12:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-08 12:37 -------
Hmm, we always set it:
static tree
cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p)
{ 
  tree initializers = NULL_TREE;
  
  /* Assume all of the expressions are constant.  */
  *non_constant_p = false;

Must be a different variable/line which you quoted that is giving the problem.

-- 


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


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

* [Bug c++/18370] cp_parser_initializer_list uninit variable problems
  2004-11-08  8:38 [Bug c++/18370] New: cp_parser_initializer_list uninit variable problems dcb314 at hotmail dot com
  2004-11-08 12:38 ` [Bug c++/18370] " pinskia at gcc dot gnu dot org
@ 2004-11-08 17:41 ` dcb314 at hotmail dot com
  2004-11-08 18:23 ` [Bug c++/18370] [3.4/4.0 Regression] " pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dcb314 at hotmail dot com @ 2004-11-08 17:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dcb314 at hotmail dot com  2004-11-08 17:41 -------
>Must be a different variable/line which you quoted that is giving the problem.

You might be correct, but valgrind always reports accurate line numbers.

The bug still seems to be file parser.c, line 11646.

Might be worth another look.

-- 


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


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

* [Bug c++/18370] [3.4/4.0 Regression] cp_parser_initializer_list uninit variable problems
  2004-11-08  8:38 [Bug c++/18370] New: cp_parser_initializer_list uninit variable problems dcb314 at hotmail dot com
  2004-11-08 12:38 ` [Bug c++/18370] " pinskia at gcc dot gnu dot org
  2004-11-08 17:41 ` dcb314 at hotmail dot com
@ 2004-11-08 18:23 ` pinskia at gcc dot gnu dot org
  2004-12-20 13:46 ` nathan at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-08 18:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-08 18:23 -------
Confirmed, I was looking at the wrong variable.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |accepts-invalid, rejects-
                   |                            |valid
   Last reconfirmed|0000-00-00 00:00:00         |2004-11-08 18:23:40
               date|                            |
            Summary|cp_parser_initializer_list  |[3.4/4.0 Regression]
                   |uninit variable problems    |cp_parser_initializer_list
                   |                            |uninit variable problems
   Target Milestone|---                         |3.4.4


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


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

* [Bug c++/18370] [3.4/4.0 Regression] cp_parser_initializer_list uninit variable problems
  2004-11-08  8:38 [Bug c++/18370] New: cp_parser_initializer_list uninit variable problems dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2004-11-08 18:23 ` [Bug c++/18370] [3.4/4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2004-12-20 13:46 ` nathan at gcc dot gnu dot org
  2005-01-25 19:48 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: nathan at gcc dot gnu dot org @ 2004-12-20 13:46 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |nathan at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/18370] [3.4/4.0 Regression] cp_parser_initializer_list uninit variable problems
  2004-11-08  8:38 [Bug c++/18370] New: cp_parser_initializer_list uninit variable problems dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2004-12-20 13:46 ` nathan at gcc dot gnu dot org
@ 2005-01-25 19:48 ` pinskia at gcc dot gnu dot org
  2005-01-26 18:59 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-25 19:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-25 19:47 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01828.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug c++/18370] [3.4/4.0 Regression] cp_parser_initializer_list uninit variable problems
  2004-11-08  8:38 [Bug c++/18370] New: cp_parser_initializer_list uninit variable problems dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2005-01-25 19:48 ` pinskia at gcc dot gnu dot org
@ 2005-01-26 18:59 ` cvs-commit at gcc dot gnu dot org
  2005-01-26 20:50 ` [Bug c++/18370] [3.4 " pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-26 18:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-01-26 18:59 -------
Subject: Bug 18370

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	amylaar@gcc.gnu.org	2005-01-26 18:59:04

Modified files:
	gcc/cp         : ChangeLog 

Log message:
	Add bug number:
	PR c++/18370
	* parse.c (cp_parser_initializer_clause): Initialize *non_constant_p.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4596&r2=1.4597



-- 


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


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

* [Bug c++/18370] [3.4 Regression] cp_parser_initializer_list uninit variable problems
  2004-11-08  8:38 [Bug c++/18370] New: cp_parser_initializer_list uninit variable problems dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2005-01-26 18:59 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-26 20:50 ` pinskia at gcc dot gnu dot org
  2005-01-27 12:55 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-26 20:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-26 20:50 -------
Fixed on the mainline now.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.0.0
            Summary|[3.4/4.0 Regression]        |[3.4 Regression]
                   |cp_parser_initializer_list  |cp_parser_initializer_list
                   |uninit variable problems    |uninit variable problems


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


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

* [Bug c++/18370] [3.4 Regression] cp_parser_initializer_list uninit variable problems
  2004-11-08  8:38 [Bug c++/18370] New: cp_parser_initializer_list uninit variable problems dcb314 at hotmail dot com
                   ` (6 preceding siblings ...)
  2005-01-26 20:50 ` [Bug c++/18370] [3.4 " pinskia at gcc dot gnu dot org
@ 2005-01-27 12:55 ` cvs-commit at gcc dot gnu dot org
  2005-01-27 12:58 ` cvs-commit at gcc dot gnu dot org
  2005-01-27 13:25 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-27 12:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-01-27 12:55 -------
Subject: Bug 18370

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	amylaar@gcc.gnu.org	2005-01-27 12:54:40

Modified files:
	gcc/cp         : ChangeLog parser.c 

Log message:
	gcc:
	* real.c (do_add): Initialize signalling and canonical members.
	
	* real.c (real_from_integer): Zero out destination.
	gcc/cp:
	PR c++/18370
	* parser.c (cp_parser_initializer_clause): Initialize *non_constant_p.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.192&r2=1.3892.2.193
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.157.2.49&r2=1.157.2.50



-- 


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


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

* [Bug c++/18370] [3.4 Regression] cp_parser_initializer_list uninit variable problems
  2004-11-08  8:38 [Bug c++/18370] New: cp_parser_initializer_list uninit variable problems dcb314 at hotmail dot com
                   ` (7 preceding siblings ...)
  2005-01-27 12:55 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-27 12:58 ` cvs-commit at gcc dot gnu dot org
  2005-01-27 13:25 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-27 12:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-01-27 12:57 -------
Subject: Bug 18370

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	amylaar@gcc.gnu.org	2005-01-27 12:57:43

Modified files:
	gcc            : ChangeLog real.c 

Log message:
	gcc:
	* real.c (do_add): Initialize signalling and canonical members.
	
	* real.c (real_from_integer): Zero out destination.
	gcc/cp:
	PR c++/18370
	* parser.c (cp_parser_initializer_clause): Initialize *non_constant_p.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.784&r2=2.2326.2.785
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/real.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.135.4.6&r2=1.135.4.7



-- 


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


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

* [Bug c++/18370] [3.4 Regression] cp_parser_initializer_list uninit variable problems
  2004-11-08  8:38 [Bug c++/18370] New: cp_parser_initializer_list uninit variable problems dcb314 at hotmail dot com
                   ` (8 preceding siblings ...)
  2005-01-27 12:58 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-27 13:25 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-27 13:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-27 13:25 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2005-01-27 13:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-08  8:38 [Bug c++/18370] New: cp_parser_initializer_list uninit variable problems dcb314 at hotmail dot com
2004-11-08 12:38 ` [Bug c++/18370] " pinskia at gcc dot gnu dot org
2004-11-08 17:41 ` dcb314 at hotmail dot com
2004-11-08 18:23 ` [Bug c++/18370] [3.4/4.0 Regression] " pinskia at gcc dot gnu dot org
2004-12-20 13:46 ` nathan at gcc dot gnu dot org
2005-01-25 19:48 ` pinskia at gcc dot gnu dot org
2005-01-26 18:59 ` cvs-commit at gcc dot gnu dot org
2005-01-26 20:50 ` [Bug c++/18370] [3.4 " pinskia at gcc dot gnu dot org
2005-01-27 12:55 ` cvs-commit at gcc dot gnu dot org
2005-01-27 12:58 ` cvs-commit at gcc dot gnu dot org
2005-01-27 13:25 ` pinskia 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).