public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/15224] New: Attribute mode causes ICE when applied to enums
@ 2004-04-30 11:52 rakdver at gcc dot gnu dot org
  2004-04-30 12:23 ` [Bug c/15224] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2004-04-30 11:52 UTC (permalink / raw)
  To: gcc-bugs

The following code

typedef enum {a, b} __attribute__((__mode__(__QI__))) x;

causes gcc to crash when checking is enabled:

uuu.c:1: internal compiler error: tree check: expected enumeral_type, have
integer_type in finish_enum, at c-decl.c:5474

When checking is disabled, the signed_char_type_node is rewritten, thus caused
misscompilation.

The above code is actually probably illegal (mode attribute is only documented
for variables, not for types), but gcc should behave more sanely.

-- 
           Summary: Attribute mode causes ICE when applied to enums
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rakdver at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c/15224] Attribute mode causes ICE when applied to enums
  2004-04-30 11:52 [Bug c/15224] New: Attribute mode causes ICE when applied to enums rakdver at gcc dot gnu dot org
@ 2004-04-30 12:23 ` pinskia at gcc dot gnu dot org
  2004-08-13 12:22 ` [Bug c/15224] [3.5 regression] " reichelt at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-30 12:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-30 11:27 -------
Confirmed but actually it is for types also and used so much for types that it should be documented as 
such.  But anyways yes GCC should act sensable in this case.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-invalid-code
   Last reconfirmed|0000-00-00 00:00:00         |2004-04-30 11:27:02
               date|                            |


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


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

* [Bug c/15224] [3.5 regression] Attribute mode causes ICE when applied to enums
  2004-04-30 11:52 [Bug c/15224] New: Attribute mode causes ICE when applied to enums rakdver at gcc dot gnu dot org
  2004-04-30 12:23 ` [Bug c/15224] " pinskia at gcc dot gnu dot org
@ 2004-08-13 12:22 ` reichelt at gcc dot gnu dot org
  2004-08-13 13:00 ` kenner at vlsi1 dot ultra dot nyu dot edu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-08-13 12:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-08-13 12:22 -------
Richard, your patch
  http://gcc.gnu.org/ml/gcc-cvs/2004-03/msg00853.html
seems to be responsible for the regression.

Could you please have a look?

I'm not sure whether the code is valid or not, but given that it compiles
up to gcc 3.4.1, I'm inclined to believe that it's valid.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kenner at gcc dot gnu dot
                   |                            |org, reichelt at gcc dot gnu
                   |                            |dot org
           Severity|minor                       |critical
           Keywords|ice-on-invalid-code         |ice-on-valid-code, monitored
      Known to fail|                            |3.5.0
      Known to work|                            |3.3.4 3.4.1
            Summary|Attribute mode causes ICE   |[3.5 regression] Attribute
                   |when applied to enums       |mode causes ICE when applied
                   |                            |to enums
   Target Milestone|---                         |3.5.0


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


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

* [Bug c/15224] [3.5 regression] Attribute mode causes ICE when applied to enums
  2004-04-30 11:52 [Bug c/15224] New: Attribute mode causes ICE when applied to enums rakdver at gcc dot gnu dot org
  2004-04-30 12:23 ` [Bug c/15224] " pinskia at gcc dot gnu dot org
  2004-08-13 12:22 ` [Bug c/15224] [3.5 regression] " reichelt at gcc dot gnu dot org
@ 2004-08-13 13:00 ` kenner at vlsi1 dot ultra dot nyu dot edu
  2004-09-01 20:09 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: kenner at vlsi1 dot ultra dot nyu dot edu @ 2004-08-13 13:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kenner at vlsi1 dot ultra dot nyu dot edu  2004-08-13 13:00 -------
Subject: Re:   [3.5 regression] Attribute mode causes ICE when applied to enums

    Richard, your patch
      http://gcc.gnu.org/ml/gcc-cvs/2004-03/msg00853.html
    seems to be responsible for the regression.

    Could you please have a look?

Actually, there was never code in the C front end to handle this.  All
my change did is to add internal checking so that the latent bug got
handled.

I have a fix for this, but I want to run it by some C front-end folks first.


-- 


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


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

* [Bug c/15224] [3.5 regression] Attribute mode causes ICE when applied to enums
  2004-04-30 11:52 [Bug c/15224] New: Attribute mode causes ICE when applied to enums rakdver at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-08-13 13:00 ` kenner at vlsi1 dot ultra dot nyu dot edu
@ 2004-09-01 20:09 ` cvs-commit at gcc dot gnu dot org
  2004-09-01 20:14 ` cvs-commit at gcc dot gnu dot org
  2004-09-01 20:45 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-09-01 20:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-09-01 20:09 -------
Subject: Bug 15224

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	kenner@gcc.gnu.org	2004-09-01 20:09:17

Modified files:
	gcc            : c-common.c c-decl.c 

Log message:
	PR c/15224
	* c-common.c (handle_mode_attribute): Handle ENUMERAL_TYPE.
	* c-decl.c (finish_enum): Check for user-specified precision too small.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&r1=1.564&r2=1.565
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&r1=1.568&r2=1.569



-- 


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


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

* [Bug c/15224] [3.5 regression] Attribute mode causes ICE when applied to enums
  2004-04-30 11:52 [Bug c/15224] New: Attribute mode causes ICE when applied to enums rakdver at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-09-01 20:09 ` cvs-commit at gcc dot gnu dot org
@ 2004-09-01 20:14 ` cvs-commit at gcc dot gnu dot org
  2004-09-01 20:45 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-09-01 20:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-09-01 20:14 -------
Subject: Bug 15224

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	kenner@gcc.gnu.org	2004-09-01 20:14:32

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.c-torture/compile: 20040901-1.c 

Log message:
	PR c/15224
	* gcc.c-torture/compile/20040901-1.c: New test, from PR.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4227&r2=1.4228
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/20040901-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c/15224] [3.5 regression] Attribute mode causes ICE when applied to enums
  2004-04-30 11:52 [Bug c/15224] New: Attribute mode causes ICE when applied to enums rakdver at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-09-01 20:14 ` cvs-commit at gcc dot gnu dot org
@ 2004-09-01 20:45 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-01 20:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-01 20:45 -------
Fixed.

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


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


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

end of thread, other threads:[~2004-09-01 20:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-30 11:52 [Bug c/15224] New: Attribute mode causes ICE when applied to enums rakdver at gcc dot gnu dot org
2004-04-30 12:23 ` [Bug c/15224] " pinskia at gcc dot gnu dot org
2004-08-13 12:22 ` [Bug c/15224] [3.5 regression] " reichelt at gcc dot gnu dot org
2004-08-13 13:00 ` kenner at vlsi1 dot ultra dot nyu dot edu
2004-09-01 20:09 ` cvs-commit at gcc dot gnu dot org
2004-09-01 20:14 ` cvs-commit at gcc dot gnu dot org
2004-09-01 20:45 ` pinskia 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).