* [Bug c++/19457] [4.0 Regression] Warning depends on cached constant
2005-01-15 12:32 [Bug c++/19457] New: Warning depends on cached constant reichelt at gcc dot gnu dot org
@ 2005-01-15 16:49 ` pinskia at gcc dot gnu dot org
2005-01-15 17:07 ` schlie at comcast dot net
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-15 16:49 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-15 16:49 -------
Confirmed, I have been wondering where this warning was coming from.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Known to fail| |4.0.0
Known to work| |3.3.2
Last reconfirmed|0000-00-00 00:00:00 |2005-01-15 16:49:22
date| |
Summary|Warning depends on cached |[4.0 Regression] Warning
|constant |depends on cached constant
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19457
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19457] [4.0 Regression] Warning depends on cached constant
2005-01-15 12:32 [Bug c++/19457] New: Warning depends on cached constant reichelt at gcc dot gnu dot org
2005-01-15 16:49 ` [Bug c++/19457] [4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2005-01-15 17:07 ` schlie at comcast dot net
2005-01-15 17:17 ` schlie at comcast dot net
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: schlie at comcast dot net @ 2005-01-15 17:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From schlie at comcast dot net 2005-01-15 17:07 -------
(In reply to comment #1)
woudn't one exect that any constant >= 0 to be compatible with signed or unsigned, where
only constants < 0 should be assumed to be only compatible with signed without a cast?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19457
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19457] [4.0 Regression] Warning depends on cached constant
2005-01-15 12:32 [Bug c++/19457] New: Warning depends on cached constant reichelt at gcc dot gnu dot org
2005-01-15 16:49 ` [Bug c++/19457] [4.0 Regression] " pinskia at gcc dot gnu dot org
2005-01-15 17:07 ` schlie at comcast dot net
@ 2005-01-15 17:17 ` schlie at comcast dot net
2005-01-15 17:36 ` schlie at comcast dot net
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: schlie at comcast dot net @ 2005-01-15 17:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From schlie at comcast dot net 2005-01-15 17:17 -------
(In reply to comment #2)
where futher then any constant not explictly negative should be considerd compatible with either
signed or unsigned assignment; thereby 0x80000000 is compatible with either, as the value is not
explicitly negative, although may be interpeted as being so iff assigned to a signed variable of
equal size, but not otherwise; it would seem.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19457
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19457] [4.0 Regression] Warning depends on cached constant
2005-01-15 12:32 [Bug c++/19457] New: Warning depends on cached constant reichelt at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-01-15 17:17 ` schlie at comcast dot net
@ 2005-01-15 17:36 ` schlie at comcast dot net
2005-01-15 18:10 ` schlie at comcast dot net
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: schlie at comcast dot net @ 2005-01-15 17:36 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From schlie at comcast dot net 2005-01-15 17:36 -------
(In reply to comment #0)
Lasly, (sorry for not collecting all thoughts first), suspect the problem may be that
~ is being considered as being analogous to an arithmetic -, which it shoudn't be;
therefore ~(any constant value >= 0) should be compatible with either signed or unsiged.
although -(any constant value >= 0) should be compatible with only signed witout a cast.
(as ~ is a bit-wise operation, not a arithmetic one, otherwise one couldn't even specify:
(unsigned)x = (unsigned)x & 0x3; without a cast, likely generating tons of useless warnings)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19457
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19457] [4.0 Regression] Warning depends on cached constant
2005-01-15 12:32 [Bug c++/19457] New: Warning depends on cached constant reichelt at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-01-15 17:36 ` schlie at comcast dot net
@ 2005-01-15 18:10 ` schlie at comcast dot net
2005-01-18 1:02 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: schlie at comcast dot net @ 2005-01-15 18:10 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From schlie at comcast dot net 2005-01-15 18:09 -------
(In reply to comment #4)
(again sorry), nor should ~0 be considred equivelent to -1, any more than any explicit
non-signed constant like 0xFFFF for example be (as previously questioned), as such
values only have equivelent representations if the constant's required representation
precision happens to be the same as the targets specifed int type-sizes; therefore
would not be reasonably target portable if treated otherwise.
(assuming for the sake of argument if sizeof(int) = 2, sizeof(long) = 4):
unsigned long = (assumed signed int compatibe) -1, long == 0xFFFFFFFF
unsigend long = (assumed unsigned int compatible)~0, long == 0x000FFFF
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19457
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19457] [4.0 Regression] Warning depends on cached constant
2005-01-15 12:32 [Bug c++/19457] New: Warning depends on cached constant reichelt at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-01-15 18:10 ` schlie at comcast dot net
@ 2005-01-18 1:02 ` pinskia at gcc dot gnu dot org
2005-01-29 2:46 ` mmitchel at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-18 1:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-18 01:02 -------
: Search converges between 2004-08-19-trunk (#518) and 2004-08-20-trunk (#519).
Almost certin this was caused by:
2004-08-19 Nathan Sidwell <nathan@codesourcery.com>
* doc/invoke.texi (integer-share-limit): Document.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |nathan at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19457
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19457] [4.0 Regression] Warning depends on cached constant
2005-01-15 12:32 [Bug c++/19457] New: Warning depends on cached constant reichelt at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-01-18 1:02 ` pinskia at gcc dot gnu dot org
@ 2005-01-29 2:46 ` mmitchel at gcc dot gnu dot org
2005-01-31 1:17 ` cvs-commit at gcc dot gnu dot org
2005-01-31 1:22 ` mmitchel at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-01-29 2:46 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2005-01-29 02:46 -------
The C++ front-end has a TREE_NEGATED_INT flag; it is that flag which is getting
cached incorrectly. The C++ front end is intentionally trying to warn about
conversions from negated integer constants, but not from conversions from things
like "~0".
--
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=19457
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19457] [4.0 Regression] Warning depends on cached constant
2005-01-15 12:32 [Bug c++/19457] New: Warning depends on cached constant reichelt at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-01-29 2:46 ` mmitchel at gcc dot gnu dot org
@ 2005-01-31 1:17 ` cvs-commit at gcc dot gnu dot org
2005-01-31 1:22 ` mmitchel at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-31 1:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-01-31 01:17 -------
Subject: Bug 19457
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2005-01-31 01:17:19
Modified files:
gcc/cp : call.c cp-tree.h semantics.c typeck.c
name-lookup.c ChangeLog
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/warn: conv3.C
Log message:
PR c++/19457
* call.c (convert_like_real): Inline call to
dubious_conversion_warnings here.
* cp-tree.h (dubious_conversion_warnings): Remove.
* semantics.c (finish_unary_op_expr): Copy INTEGER_CSTs before
setting TREE_NEGATED_INT.
* typeck.c (dubious_conversion_warnings): Remove.
PR c++/19349
* name-lookup.c (pushdecl_namespace_level): Avoid accessing free'd
memory.
PR c++/19457
* g++.dg/warn/conv3.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.527&r2=1.528
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.1097&r2=1.1098
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.458&r2=1.459
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.609&r2=1.610
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.c.diff?cvsroot=gcc&r1=1.106&r2=1.107
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4601&r2=1.4602
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/conv3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4959&r2=1.4960
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19457
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19457] [4.0 Regression] Warning depends on cached constant
2005-01-15 12:32 [Bug c++/19457] New: Warning depends on cached constant reichelt at gcc dot gnu dot org
` (7 preceding siblings ...)
2005-01-31 1:17 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-31 1:22 ` mmitchel at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-01-31 1:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2005-01-31 01:22 -------
Fixed in 4.0.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19457
^ permalink raw reply [flat|nested] 10+ messages in thread