public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/27273]  New: tree check fail for legal code
@ 2006-04-23 19:09 dcb314 at hotmail dot com
  2006-04-23 19:12 ` [Bug c/27273] " dcb314 at hotmail dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: dcb314 at hotmail dot com @ 2006-04-23 19:09 UTC (permalink / raw)
  To: gcc-bugs

I just tried to compile Linux kernel version 2.6.16.9 with a recent
GNU C compiler version 4.2 snapshot 20060422. 

The compiler snapshot said

  /home/dcb/gnu/42-20060422/results/bin/gcc -g -O3 -Wall 
-Wp,-MD,drivers/char/.synclink_gt.o.d  -nostdinc -isystem
/home/dcb/gnu/42-20060422/results/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/include
-D__KERNEL__ -Iinclude  -include include/linux/autoconf.h -Wall -Wundef
-Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
-ffreestanding -Os     -fno-omit-frame-pointer -fno-optimize-sibling-calls -g
-march=k8 -m64 -mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks   
-Wno-sign-compare -fno-asynchronous-unwind-tables -funit-at-a-time -mno-sse
-mno-mmx -mno-sse2 -mno-3dnow -Wdeclaration-after-statement -Wno-pointer-sign  
 -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(synclink_gt)" 
-D"KBUILD_MODNAME=KBUILD_STR(synclink_gt)" -c -o
drivers/char/.tmp_synclink_gt.o drivers/char/synclink_gt.c
drivers/char/synclink_gt.c: In function 'rx_async':
drivers/char/synclink_gt.c:1774: internal compiler error: tree check: expected
class 'constant', have 'binary' (bit_and_expr) in convert_and_check, at
c-common.c:1083
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[2]: *** [drivers/char/synclink_gt.o] Error 1

Preprocessed source code attached.  No special flags required.


-- 
           Summary: tree check fail for legal code
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dcb314 at hotmail dot com
  GCC host triplet: i686-pc-linux-gnu


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


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

* [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

end of thread, other threads:[~2006-05-30 13:44 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [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
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
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
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

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).