Bug 17341 - [4.0 Regression] Bogus "unused parameter" warning with -O3
Summary: [4.0 Regression] Bogus "unused parameter" warning with -O3
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2004-09-06 23:57 UTC by James McKelvey
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: alphaev56-unknown-linux-gnu
Target: alphaev56-unknown-linux-gnu
Build: alphaev56-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Preprocessed source (154.23 KB, application/octet-stream)
2004-09-06 23:59 UTC, James McKelvey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James McKelvey 2004-09-06 23:57:12 UTC
This "unused parameter" warning shows up with optimization. The parameter is
actually used.


/usr/local/bin/g++ -c -O3 -DNDEBUG      -D__USE_STRING_INLINES=1
-pedantic-errors -Werror -ansi -fno-common -fstrict-aliasing -Wall
-Wold-style-cast -Wsign-promo -Wpointer-arith -Wconversion -Wundef
-Wwrite-strings -Winvalid-pch -Woverloaded-virtual -Wcast-qual
-finline-limit=5000 -Wextra -MMD      -fimplicit-templates -I. -I.. -o rot13.o
rot13.cc
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:
In constructor `std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Rb_tree(const _Compare&, const _Alloc&) [with _Key =
PatternDriver::pdstring, _Val = std::pair<const PatternDriver::pdstring,
PatternDriver::pdboolean>, _KeyOfValue = std::_Select1st<std::pair<const
PatternDriver::pdstring, PatternDriver::pdboolean> >, _Compare =
std::less<PatternDriver::pdstring>, _Alloc = std::allocator<std::pair<const
PatternDriver::pdstring, PatternDriver::pdboolean> >]':
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:520:
warning: unused parameter '__a'
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:
In constructor `std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Rb_tree(const _Compare&, const _Alloc&) [with _Key =
PatternDriver::pdstring, _Val = std::pair<const PatternDriver::pdstring,
PatternDriver::pdstrings>, _KeyOfValue = std::_Select1st<std::pair<const
PatternDriver::pdstring, PatternDriver::pdstrings> >, _Compare =
std::less<PatternDriver::pdstring>, _Alloc = std::allocator<std::pair<const
PatternDriver::pdstring, PatternDriver::pdstrings> >]':
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:520:
warning: unused parameter '__a'
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:
In constructor `std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Rb_tree(const _Compare&, const _Alloc&) [with _Key =
PatternDriver::pdstring, _Val = std::pair<const PatternDriver::pdstring,
PatternDriver::pdintegers>, _KeyOfValue = std::_Select1st<std::pair<const
PatternDriver::pdstring, PatternDriver::pdintegers> >, _Compare =
std::less<PatternDriver::pdstring>, _Alloc = std::allocator<std::pair<const
PatternDriver::pdstring, PatternDriver::pdintegers> >]':
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:520:
warning: unused parameter '__a'
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:
In constructor `std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Rb_tree(const _Compare&, const _Alloc&) [with _Key =
PatternDriver::pdstring, _Val = std::pair<const PatternDriver::pdstring,
PatternDriver::pdfloats>, _KeyOfValue = std::_Select1st<std::pair<const
PatternDriver::pdstring, PatternDriver::pdfloats> >, _Compare =
std::less<PatternDriver::pdstring>, _Alloc = std::allocator<std::pair<const
PatternDriver::pdstring, PatternDriver::pdfloats> >]':
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:520:
warning: unused parameter '__a'
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:
In constructor `std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_Rb_tree(const _Compare&, const _Alloc&) [with _Key =
PatternDriver::pdstring, _Val = std::pair<const PatternDriver::pdstring,
PatternDriver::pdbooleans>, _KeyOfValue = std::_Select1st<std::pair<const
PatternDriver::pdstring, PatternDriver::pdbooleans> >, _Compare =
std::less<PatternDriver::pdstring>, _Alloc = std::allocator<std::pair<const
PatternDriver::pdstring, PatternDriver::pdbooleans> >]':
/usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_tree.h:520:
warning: unused parameter '__a'
gmake: *** [rot13.o] Error 1


alpha1:PD>uname -a
Linux alpha1 2.4.9-40 #1 Mon Sep 23 08:14:02 EDT 2002 alpha unknown

alpha1:PD>g++ -v
Reading specs from /usr/local/lib/gcc/alphaev56-unknown-linux-gnu/3.5.0/specs
Configured with: ../gcc/configure --verbose --enable-languages=c++
Thread model: posix
gcc version 3.5.0 20040207 (experimental)

Configured:
alpha1:PD>alias CONFIGURECVS
alias CONFIGURECVS='../gcc/configure --verbose --enable-languages=c++
--disable-nls >clog 2>&1'

Built:
alpha1:PD>alias BUILD
alias BUILD='nice gmake CFLAGS='\'''\'' BOOT_CFLAGS='\''-O'\'' LIBCFLAGS='\''-g
-O'\'' LIBCXXFLAGS='\''-g -O'\'' bootstrap >log 2>&1'
Comment 1 James McKelvey 2004-09-06 23:59:26 UTC
Created attachment 7058 [details]
Preprocessed source
Comment 2 Andrew Pinski 2004-09-09 03:41:10 UTC
The only warnings I get are for 
pr17341.cc:22444: warning: suggest parentheses around assignment used as truth value


Does this still happen?
Comment 3 Giovanni Bajo 2004-09-09 10:11:05 UTC
Waiting for user's feedback
Comment 4 James McKelvey 2004-09-12 19:02:40 UTC
Subject: Re:  [3.5 Regression] Bogus "unused parameter" warning with -O3

On Wednesday 08 September 2004 20:41 pm, pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-09
> 03:41 ------- The only warnings I get are for
> pr17341.cc:22444: warning: suggest parentheses around assignment used as
> truth value
>
>
> Does this still happen?

I was able to bootstrap yesterday, and I no longer see this problem.
Comment 5 Andrew Pinski 2004-09-12 19:08:57 UTC
So closing as fixed.