public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/35748]  New: ICE with cast to invalid union
@ 2008-03-28 22:03 reichelt at gcc dot gnu dot org
  2008-03-29 20:18 ` [Bug c/35748] " reichelt at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-03-28 22:03 UTC (permalink / raw)
  To: gcc-bugs

The following invalid code snippet triggers an ICE since at least GCC 2.95.3:

=================================
union U { void x[1]; };

void foo()
{
  (union U)0;
}
=================================

bug.c:1: error: declaration of 'x' as array of voids
bug.c: In function 'foo':
bug.c:5: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in build_c_cast, at c-typeck.c:3631
Please submit a full bug report, [etc.]


-- 
           Summary: ICE with cast to invalid union
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, monitored
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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

* [Bug c/35748] ICE with cast to invalid union
  2008-03-28 22:03 [Bug c/35748] New: ICE with cast to invalid union reichelt at gcc dot gnu dot org
@ 2008-03-29 20:18 ` reichelt at gcc dot gnu dot org
  2008-03-30 22:00 ` reichelt at gcc dot gnu dot org
  2008-03-30 22:09 ` reichelt at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-03-29 20:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from reichelt at gcc dot gnu dot org  2008-03-29 20:18 -------
Testing a patch.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |reichelt at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-03-29 20:18:08
               date|                            |


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


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

* [Bug c/35748] ICE with cast to invalid union
  2008-03-28 22:03 [Bug c/35748] New: ICE with cast to invalid union reichelt at gcc dot gnu dot org
  2008-03-29 20:18 ` [Bug c/35748] " reichelt at gcc dot gnu dot org
@ 2008-03-30 22:00 ` reichelt at gcc dot gnu dot org
  2008-03-30 22:09 ` reichelt at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-03-30 22:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from reichelt at gcc dot gnu dot org  2008-03-30 21:59 -------
Subject: Bug 35748

Author: reichelt
Date: Sun Mar 30 21:58:43 2008
New Revision: 133737

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133737
Log:
        PR c/35748
        * c-typeck.c (build_c_cast): Skip invalid fields in unions.

        * gcc.dg/union-cast-4.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/union-cast-4.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-typeck.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c/35748] ICE with cast to invalid union
  2008-03-28 22:03 [Bug c/35748] New: ICE with cast to invalid union reichelt at gcc dot gnu dot org
  2008-03-29 20:18 ` [Bug c/35748] " reichelt at gcc dot gnu dot org
  2008-03-30 22:00 ` reichelt at gcc dot gnu dot org
@ 2008-03-30 22:09 ` reichelt at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-03-30 22:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from reichelt at gcc dot gnu dot org  2008-03-30 22:09 -------
Fixed on mainline.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.4.0


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


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

end of thread, other threads:[~2008-03-30 22:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-28 22:03 [Bug c/35748] New: ICE with cast to invalid union reichelt at gcc dot gnu dot org
2008-03-29 20:18 ` [Bug c/35748] " reichelt at gcc dot gnu dot org
2008-03-30 22:00 ` reichelt at gcc dot gnu dot org
2008-03-30 22:09 ` reichelt 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).