public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14199] New: [tree-ssa regression] Unjustified warning about unused variable
@ 2004-02-18 20:25 bangerth at dealii dot org
  2004-02-18 20:26 ` [Bug c++/14199] " bangerth at dealii dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: bangerth at dealii dot org @ 2004-02-18 20:25 UTC (permalink / raw)
  To: gcc-bugs

Here is some recent regression I see on tree-ssa. I don't have a recent 
mainline checked out, so can't test whether this also happens on mainline, 
but here is what happens: 
----------------------------- 
struct X { 
    static void foo (); 
}; 
 
template <typename T> 
void foo (const T &t) { 
  t.foo(); 
} 
 
template void foo (const X &); 
------------------- 
 
deal.II/base> c++ -c -Wunused x.cc -W -Wall  
x.cc: In function `void foo(const T&) [with T = X]': 
x.cc:10:   instantiated from here 
x.cc:6: warning: unused parameter 't' 
 
This warning is clearly bogus! 
 
W.

-- 
           Summary: [tree-ssa regression] Unjustified warning about unused
                    variable
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/14199] [tree-ssa regression] Unjustified warning about unused variable
  2004-02-18 20:25 [Bug c++/14199] New: [tree-ssa regression] Unjustified warning about unused variable bangerth at dealii dot org
@ 2004-02-18 20:26 ` bangerth at dealii dot org
  2004-02-18 21:55 ` gerald at pfeifer dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bangerth at dealii dot org @ 2004-02-18 20:26 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
   Target Milestone|---                         |tree-ssa


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


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

* [Bug c++/14199] [tree-ssa regression] Unjustified warning about unused variable
  2004-02-18 20:25 [Bug c++/14199] New: [tree-ssa regression] Unjustified warning about unused variable bangerth at dealii dot org
  2004-02-18 20:26 ` [Bug c++/14199] " bangerth at dealii dot org
@ 2004-02-18 21:55 ` gerald at pfeifer dot com
  2004-02-18 21:59 ` bangerth at dealii dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: gerald at pfeifer dot com @ 2004-02-18 21:55 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gerald at pfeifer dot com


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


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

* [Bug c++/14199] [tree-ssa regression] Unjustified warning about unused variable
  2004-02-18 20:25 [Bug c++/14199] New: [tree-ssa regression] Unjustified warning about unused variable bangerth at dealii dot org
  2004-02-18 20:26 ` [Bug c++/14199] " bangerth at dealii dot org
  2004-02-18 21:55 ` gerald at pfeifer dot com
@ 2004-02-18 21:59 ` bangerth at dealii dot org
  2004-02-18 22:04 ` bangerth at dealii dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bangerth at dealii dot org @ 2004-02-18 21:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-02-18 21:59 -------
I just checked that it indeed also fails on mainline. So tree-ssa 
only inherited this problem. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |tree-ssa 3.5.0
   Target Milestone|tree-ssa                    |3.5.0
            Version|tree-ssa                    |3.5.0


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


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

* [Bug c++/14199] [tree-ssa regression] Unjustified warning about unused variable
  2004-02-18 20:25 [Bug c++/14199] New: [tree-ssa regression] Unjustified warning about unused variable bangerth at dealii dot org
                   ` (2 preceding siblings ...)
  2004-02-18 21:59 ` bangerth at dealii dot org
@ 2004-02-18 22:04 ` bangerth at dealii dot org
  2004-02-18 22:09 ` [Bug c++/14199] [3.4/3.5 " pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bangerth at dealii dot org @ 2004-02-18 22:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-02-18 22:04 -------
Actually, when I extracted this small snippet, I didn't even really think 
what it is about. The point is that the compiler really has some right 
to say that the object is unused: the function we call is static, so the 
object is really unused. It does make use to not issue the warning, though, 
since the template may as well be instantiated for classes for which this 
function is not static, and there is no good reason to show an warning message 
in one, but not the other case. So, in a sense, a patch will have to 
broaden the meaning of the word "unused"... 
 
W. 

-- 


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


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

* [Bug c++/14199] [3.4/3.5 regression] Unjustified warning about unused variable
  2004-02-18 20:25 [Bug c++/14199] New: [tree-ssa regression] Unjustified warning about unused variable bangerth at dealii dot org
                   ` (3 preceding siblings ...)
  2004-02-18 22:04 ` bangerth at dealii dot org
@ 2004-02-18 22:09 ` pinskia at gcc dot gnu dot org
  2004-02-19  0:37 ` bangerth at dealii dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-18 22:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-18 22:09 -------
Confirmed.  It also happens in 3.4.0 and 3.5.0, the probelm is that the variable is really not used 
because the function is static.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|tree-ssa 3.5.0              |3.4.0 3.5.0
      Known to work|                            |3.3.3
   Last reconfirmed|0000-00-00 00:00:00         |2004-02-18 22:09:49
               date|                            |
            Summary|[tree-ssa regression]       |[3.4/3.5 regression]
                   |Unjustified warning about   |Unjustified warning about
                   |unused variable             |unused variable
   Target Milestone|3.5.0                       |3.4.0


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


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

* [Bug c++/14199] [3.4/3.5 regression] Unjustified warning about unused variable
  2004-02-18 20:25 [Bug c++/14199] New: [tree-ssa regression] Unjustified warning about unused variable bangerth at dealii dot org
                   ` (4 preceding siblings ...)
  2004-02-18 22:09 ` [Bug c++/14199] [3.4/3.5 " pinskia at gcc dot gnu dot org
@ 2004-02-19  0:37 ` bangerth at dealii dot org
  2004-02-20  2:20 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bangerth at dealii dot org @ 2004-02-19  0:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-02-19 00:37 -------
Looking at my logfiles: I believe this bug has been introduced in the last two to three 
days. Maybe someone can figure out which patch this was. 
 
W. 

-- 


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


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

* [Bug c++/14199] [3.4/3.5 regression] Unjustified warning about unused variable
  2004-02-18 20:25 [Bug c++/14199] New: [tree-ssa regression] Unjustified warning about unused variable bangerth at dealii dot org
                   ` (5 preceding siblings ...)
  2004-02-19  0:37 ` bangerth at dealii dot org
@ 2004-02-20  2:20 ` pinskia at gcc dot gnu dot org
  2004-02-20  7:23 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-20  2:20 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor


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


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

* [Bug c++/14199] [3.4/3.5 regression] Unjustified warning about unused variable
  2004-02-18 20:25 [Bug c++/14199] New: [tree-ssa regression] Unjustified warning about unused variable bangerth at dealii dot org
                   ` (6 preceding siblings ...)
  2004-02-20  2:20 ` pinskia at gcc dot gnu dot org
@ 2004-02-20  7:23 ` mmitchel at gcc dot gnu dot org
  2004-02-20  8:57 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-02-20  7:23 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/14199] [3.4/3.5 regression] Unjustified warning about unused variable
  2004-02-18 20:25 [Bug c++/14199] New: [tree-ssa regression] Unjustified warning about unused variable bangerth at dealii dot org
                   ` (7 preceding siblings ...)
  2004-02-20  7:23 ` mmitchel at gcc dot gnu dot org
@ 2004-02-20  8:57 ` cvs-commit at gcc dot gnu dot org
  2004-02-20  9:03 ` cvs-commit at gcc dot gnu dot org
  2004-02-20  9:05 ` mmitchel at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-20  8:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-20 08:57 -------
Subject: Bug 14199

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-02-20 08:57:33

Modified files:
	gcc/cp         : ChangeLog decl.c name-lookup.c pt.c semantics.c 
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/g++.dg/other: error8.C 
Added files:
	gcc/testsuite/g++.dg/ext: packed5.C 
	gcc/testsuite/g++.dg/warn: Wunused-5.C 

Log message:
	PR c++/14199
	* pt.c (tsubst_copy): Call mark_used for a PARM_DECL.
	
	PR c++/14173
	* semantics.c (begin_class_definition): Set TYPE_PACKED correctly
	for all type variants.
	
	PR c++/14173
	* g++.dg/ext/packed5.C: New test.
	
	PR c++/14199
	* g++.dg/warn/Wunused-5.C: New test.
	
	PR c++/13927
	* decl.c (duplicate_decls): Return error_mark_node for invalid
	redeclarations.
	* name-lookup.c (push_namespace): Ignore the return value from
	pushdecl.
	* pt.c (push_template_decl_real): Robustify.
	
	PR c++/13927
	* g++.dg/other/error8.C: Remove XFAIL markers.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3962&r2=1.3963
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1187&r2=1.1188
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.c.diff?cvsroot=gcc&r1=1.39&r2=1.40
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.830&r2=1.831
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.388&r2=1.389
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3523&r2=1.3524
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/packed5.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/other/error8.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/Wunused-5.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c++/14199] [3.4/3.5 regression] Unjustified warning about unused variable
  2004-02-18 20:25 [Bug c++/14199] New: [tree-ssa regression] Unjustified warning about unused variable bangerth at dealii dot org
                   ` (8 preceding siblings ...)
  2004-02-20  8:57 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-20  9:03 ` cvs-commit at gcc dot gnu dot org
  2004-02-20  9:05 ` mmitchel at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-20  9:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-20 09:03 -------
Subject: Bug 14199

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-02-20 09:03:34

Modified files:
	gcc/cp         : ChangeLog pt.c semantics.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/ext: packed5.C 
	gcc/testsuite/g++.dg/warn: Wunused-5.C 

Log message:
	PR c++/14199
	* pt.c (tsubst_copy): Call mark_used for a PARM_DECL.
	
	PR c++/14173
	* semantics.c (begin_class_definition): Set TYPE_PACKED correctly
	for all type variants.
	
	PR c++/14173
	* g++.dg/ext/packed5.C: New test.
	
	PR c++/14199
	* g++.dg/warn/Wunused-5.C: New test.

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.57&r2=1.3892.2.58
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.11&r2=1.816.2.12
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.381.4.7&r2=1.381.4.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.95&r2=1.3389.2.96
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/packed5.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/Wunused-5.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

* [Bug c++/14199] [3.4/3.5 regression] Unjustified warning about unused variable
  2004-02-18 20:25 [Bug c++/14199] New: [tree-ssa regression] Unjustified warning about unused variable bangerth at dealii dot org
                   ` (9 preceding siblings ...)
  2004-02-20  9:03 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-20  9:05 ` mmitchel at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-02-20  9:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-02-20 09:05 -------
Fixed in GCC 3.4.

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


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


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

end of thread, other threads:[~2004-02-20  9:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-18 20:25 [Bug c++/14199] New: [tree-ssa regression] Unjustified warning about unused variable bangerth at dealii dot org
2004-02-18 20:26 ` [Bug c++/14199] " bangerth at dealii dot org
2004-02-18 21:55 ` gerald at pfeifer dot com
2004-02-18 21:59 ` bangerth at dealii dot org
2004-02-18 22:04 ` bangerth at dealii dot org
2004-02-18 22:09 ` [Bug c++/14199] [3.4/3.5 " pinskia at gcc dot gnu dot org
2004-02-19  0:37 ` bangerth at dealii dot org
2004-02-20  2:20 ` pinskia at gcc dot gnu dot org
2004-02-20  7:23 ` mmitchel at gcc dot gnu dot org
2004-02-20  8:57 ` cvs-commit at gcc dot gnu dot org
2004-02-20  9:03 ` cvs-commit at gcc dot gnu dot org
2004-02-20  9:05 ` mmitchel 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).