* [Bug c/27273] tree check fail for legal code
2006-04-23 19:09 [Bug c/27273] New: tree check fail for legal code dcb314 at hotmail dot com
@ 2006-04-23 19:12 ` dcb314 at hotmail dot com
2006-04-23 19:34 ` [Bug c/27273] [4.2 regression] " falk at debian dot org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: dcb314 at hotmail dot com @ 2006-04-23 19:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from dcb314 at hotmail dot com 2006-04-23 19:12 -------
Created an attachment (id=11319)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11319&action=view)
C source code
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/27273] [4.2 regression] tree check fail for legal code
2006-04-23 19:09 [Bug c/27273] New: tree check fail for legal code dcb314 at hotmail dot com
2006-04-23 19:12 ` [Bug c/27273] " dcb314 at hotmail dot com
@ 2006-04-23 19:34 ` falk at debian dot org
2006-04-23 20:13 ` [Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant pinskia at gcc dot gnu dot org
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: falk at debian dot org @ 2006-04-23 19:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from falk at debian dot org 2006-04-23 19:34 -------
Confirmed. Test case:
unsigned char rx_async(unsigned char p) {
return p & 512;
}
--
falk at debian dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |ice-on-valid-code
Known to fail| |4.2.0
Known to work| |4.0.3 4.1.0
Summary|tree check fail for legal |[4.2 regression] tree check
|code |fail for legal code
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
2006-04-23 19:09 [Bug c/27273] New: tree check fail for legal code dcb314 at hotmail dot com
2006-04-23 19:12 ` [Bug c/27273] " dcb314 at hotmail dot com
2006-04-23 19:34 ` [Bug c/27273] [4.2 regression] " falk at debian dot org
@ 2006-04-23 20:13 ` pinskia at gcc dot gnu dot org
2006-04-24 17:07 ` reichelt at gcc dot gnu dot org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-23 20:13 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
GCC host triplet|i686-pc-linux-gnu |
Summary|[4.2 regression] tree check |[4.2 regression] tree check
|fail for legal code |fail for legal code when
| |convert returns a constant
| |from an expression that was
| |not constant
Target Milestone|--- |4.2.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
2006-04-23 19:09 [Bug c/27273] New: tree check fail for legal code dcb314 at hotmail dot com
` (2 preceding siblings ...)
2006-04-23 20:13 ` [Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant pinskia at gcc dot gnu dot org
@ 2006-04-24 17:07 ` reichelt at gcc dot gnu dot org
2006-04-30 8:04 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-04-24 17:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from reichelt at gcc dot gnu dot org 2006-04-24 17:07 -------
*** Bug 27281 has been marked as a duplicate of this bug. ***
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tbm at cyrius dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
2006-04-23 19:09 [Bug c/27273] New: tree check fail for legal code dcb314 at hotmail dot com
` (3 preceding siblings ...)
2006-04-24 17:07 ` reichelt at gcc dot gnu dot org
@ 2006-04-30 8:04 ` pinskia at gcc dot gnu dot org
2006-05-07 2:54 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-30 8:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2006-04-30 08:04 -------
This patch works for me (I have not fully test it yet though):
Index: c-common.c
===================================================================
--- c-common.c (revision 113388)
+++ c-common.c (working copy)
@@ -1080,7 +1080,8 @@ convert_and_check (tree type, tree expr)
/* Do not diagnose overflow in a constant expression merely
because a conversion overflowed. */
- TREE_CONSTANT_OVERFLOW (t) = TREE_CONSTANT_OVERFLOW (expr);
+ if (TREE_CODE (expr) == INTEGER_CST)
+ TREE_CONSTANT_OVERFLOW (t) = TREE_CONSTANT_OVERFLOW (expr);
/* No warning for converting 0x80000000 to int. */
if (!(TYPE_UNSIGNED (type) < TYPE_UNSIGNED (TREE_TYPE (expr))
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
2006-04-23 19:09 [Bug c/27273] New: tree check fail for legal code dcb314 at hotmail dot com
` (4 preceding siblings ...)
2006-04-30 8:04 ` pinskia at gcc dot gnu dot org
@ 2006-05-07 2:54 ` pinskia at gcc dot gnu dot org
2006-05-08 7:57 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-07 2:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2006-05-07 02:54 -------
*** Bug 27462 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |marcus at jet dot franken
| |dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
2006-04-23 19:09 [Bug c/27273] New: tree check fail for legal code dcb314 at hotmail dot com
` (5 preceding siblings ...)
2006-05-07 2:54 ` pinskia at gcc dot gnu dot org
@ 2006-05-08 7:57 ` pinskia at gcc dot gnu dot org
2006-05-08 8:40 ` mueller at gcc dot gnu dot org
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-08 7:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2006-05-08 07:57 -------
Mine.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
2006-04-23 19:09 [Bug c/27273] New: tree check fail for legal code dcb314 at hotmail dot com
` (6 preceding siblings ...)
2006-05-08 7:57 ` pinskia at gcc dot gnu dot org
@ 2006-05-08 8:40 ` mueller at gcc dot gnu dot org
2006-05-08 20:48 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: mueller at gcc dot gnu dot org @ 2006-05-08 8:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from mueller at gcc dot gnu dot org 2006-05-08 08:40 -------
Ah, just missed it by a few minutes :)
I've been using this patch:
=== CUT ===
--- c-common.c (revision 113532)
+++ c-common.c (working copy)
@@ -1077,7 +1077,7 @@ convert_and_check (tree type, tree expr)
tree t = convert (type, expr);
if (TREE_CODE (t) == INTEGER_CST)
{
- if (TREE_OVERFLOW (t))
+ if (TREE_OVERFLOW (t) && CONSTANT_CLASS_P (expr))
{
TREE_OVERFLOW (t) = 0;
=== CUT ===
and it seems to bootstrap and regtest fine (not closely checked against
vanilla tree yet).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
2006-04-23 19:09 [Bug c/27273] New: tree check fail for legal code dcb314 at hotmail dot com
` (7 preceding siblings ...)
2006-05-08 8:40 ` mueller at gcc dot gnu dot org
@ 2006-05-08 20:48 ` pinskia at gcc dot gnu dot org
2006-05-14 18:38 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-08 20:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from pinskia at gcc dot gnu dot org 2006-05-08 20:47 -------
(In reply to comment #7)
> Ah, just missed it by a few minutes :)
You can take it still, I still have some copyright issues to resolve.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
2006-04-23 19:09 [Bug c/27273] New: tree check fail for legal code dcb314 at hotmail dot com
` (8 preceding siblings ...)
2006-05-08 20:48 ` pinskia at gcc dot gnu dot org
@ 2006-05-14 18:38 ` pinskia at gcc dot gnu dot org
2006-05-16 8:37 ` mueller at gcc dot gnu dot org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-14 18:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from pinskia at gcc dot gnu dot org 2006-05-14 18:38 -------
*** Bug 27602 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |happyarch at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
2006-04-23 19:09 [Bug c/27273] New: tree check fail for legal code dcb314 at hotmail dot com
` (9 preceding siblings ...)
2006-05-14 18:38 ` pinskia at gcc dot gnu dot org
@ 2006-05-16 8:37 ` mueller at gcc dot gnu dot org
2006-05-19 17:35 ` patchapp at dberlin dot org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: mueller at gcc dot gnu dot org @ 2006-05-16 8:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from mueller at gcc dot gnu dot org 2006-05-16 08:37 -------
ok, rerunning regtest
--
mueller at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|pinskia at gcc dot gnu dot |mueller at gcc dot gnu dot
|org |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
2006-04-23 19:09 [Bug c/27273] New: tree check fail for legal code dcb314 at hotmail dot com
` (10 preceding siblings ...)
2006-05-16 8:37 ` mueller at gcc dot gnu dot org
@ 2006-05-19 17:35 ` patchapp at dberlin dot org
2006-05-30 13:44 ` mueller at gcc dot gnu dot org
2006-05-30 13:44 ` mueller at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: patchapp at dberlin dot org @ 2006-05-19 17:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from patchapp at dberlin dot org 2006-05-19 17:35 -------
Subject: Bug number PR c/27273
A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-05/msg00964.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
2006-04-23 19:09 [Bug c/27273] New: tree check fail for legal code dcb314 at hotmail dot com
` (11 preceding siblings ...)
2006-05-19 17:35 ` patchapp at dberlin dot org
@ 2006-05-30 13:44 ` mueller at gcc dot gnu dot org
2006-05-30 13:44 ` mueller at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: mueller at gcc dot gnu dot org @ 2006-05-30 13:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from mueller at gcc dot gnu dot org 2006-05-30 13:44 -------
Fixed.
--
mueller at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
2006-04-23 19:09 [Bug c/27273] New: tree check fail for legal code dcb314 at hotmail dot com
` (12 preceding siblings ...)
2006-05-30 13:44 ` mueller at gcc dot gnu dot org
@ 2006-05-30 13:44 ` mueller at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: mueller at gcc dot gnu dot org @ 2006-05-30 13:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from mueller at gcc dot gnu dot org 2006-05-30 13:44 -------
Subject: Bug 27273
Author: mueller
Date: Tue May 30 13:43:55 2006
New Revision: 114238
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114238
Log:
PR c/27273
* c-common.c (convert_and_check): only track TREE_CONSTANT_OVERFLOW
for CONSTANT_CLASS_P expressions.
* gcc.dg/overflow-warn-5.c: New testcase.
Added:
trunk/gcc/testsuite/gcc.dg/overflow-warn-5.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-common.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
^ permalink raw reply [flat|nested] 15+ messages in thread