public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/54355] New: ICE on invalid code in switch statement
@ 2012-08-23  9:48 jay.foad at gmail dot com
  2012-08-23 11:22 ` [Bug c/54355] " jakub at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jay.foad at gmail dot com @ 2012-08-23  9:48 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54355
           Summary: ICE on invalid code in switch statement
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jay.foad@gmail.com


Created attachment 28067
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28067
test case

On the attached test case I get:


$ cc1 reduced.c
 f
reduced.c: In function 'f':
reduced.c:5:1: error: a label can only be part of a statement and a declaration
is not a statement
 a b >
 ^
reduced.c:5:1: error: unknown type name 'a'
reduced.c:5:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before
'>' token
 a b >
     ^
reduced.c:5:5: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


I'm using trunk revision 190616 on x86_64-unknown-linux-gnu.

Credit: test case was reduced by C-Reduce: http://embed.cs.utah.edu/creduce/


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

* [Bug c/54355] ICE on invalid code in switch statement
  2012-08-23  9:48 [Bug c/54355] New: ICE on invalid code in switch statement jay.foad at gmail dot com
@ 2012-08-23 11:22 ` jakub at gcc dot gnu.org
  2012-08-23 11:24 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-08-23 11:22 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
                 CC|                            |jakub at gcc dot gnu.org
   Target Milestone|---                         |4.8.0


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

* [Bug c/54355] ICE on invalid code in switch statement
  2012-08-23  9:48 [Bug c/54355] New: ICE on invalid code in switch statement jay.foad at gmail dot com
  2012-08-23 11:22 ` [Bug c/54355] " jakub at gcc dot gnu.org
@ 2012-08-23 11:24 ` jakub at gcc dot gnu.org
  2012-08-23 11:57 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-08-23 11:24 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-08-23
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-08-23 11:24:36 UTC ---
Created attachment 28068
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28068
gcc48-pr54355.patch

Untested fix.

While for the nested case c_push_function_context/c_pop_function_context around
start_function restores the globals on failure, for the !nested case which
includes extern fn decls (or suspected extern fn decls) nothing restores them.


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

* [Bug c/54355] ICE on invalid code in switch statement
  2012-08-23  9:48 [Bug c/54355] New: ICE on invalid code in switch statement jay.foad at gmail dot com
  2012-08-23 11:22 ` [Bug c/54355] " jakub at gcc dot gnu.org
  2012-08-23 11:24 ` jakub at gcc dot gnu.org
@ 2012-08-23 11:57 ` jakub at gcc dot gnu.org
  2012-08-24 21:45 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-08-23 11:57 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #28068|0                           |1
        is obsolete|                            |

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-08-23 11:56:51 UTC ---
Created attachment 28073
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28073
gcc48-pr54355.patch

Actually, it seems the comments added in PR29062 disagree with what is actually
passed, two arguments are swapped.  Dunno about the best empty_ok value in that
case, but certainly nested should be true, we are definitely inside of a
function already.


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

* [Bug c/54355] ICE on invalid code in switch statement
  2012-08-23  9:48 [Bug c/54355] New: ICE on invalid code in switch statement jay.foad at gmail dot com
                   ` (2 preceding siblings ...)
  2012-08-23 11:57 ` jakub at gcc dot gnu.org
@ 2012-08-24 21:45 ` jakub at gcc dot gnu.org
  2013-03-22 14:43 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-08-24 21:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-08-24 21:45:28 UTC ---
Author: jakub
Date: Fri Aug 24 21:45:22 2012
New Revision: 190656

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190656
Log:
    PR c/54355
    * c-decl.c (c_parser_label): Pass true as nested and fix up comments
    for nested and empty_ok arguments in the call to
    c_parser_declaration_or_fndef.

    * gcc.dg/pr54355.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr54355.c
Modified:
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-parser.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c/54355] ICE on invalid code in switch statement
  2012-08-23  9:48 [Bug c/54355] New: ICE on invalid code in switch statement jay.foad at gmail dot com
                   ` (3 preceding siblings ...)
  2012-08-24 21:45 ` jakub at gcc dot gnu.org
@ 2013-03-22 14:43 ` jakub at gcc dot gnu.org
  2013-05-31 10:58 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-03-22 14:43 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.0                       |4.8.1

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-22 14:42:48 UTC ---
GCC 4.8.0 is being released, adjusting target milestone.


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

* [Bug c/54355] ICE on invalid code in switch statement
  2012-08-23  9:48 [Bug c/54355] New: ICE on invalid code in switch statement jay.foad at gmail dot com
                   ` (4 preceding siblings ...)
  2013-03-22 14:43 ` jakub at gcc dot gnu.org
@ 2013-05-31 10:58 ` jakub at gcc dot gnu.org
  2013-10-16  9:51 ` jakub at gcc dot gnu.org
  2013-10-17 20:17 ` mpolacek at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-05-31 10:58 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.1                       |4.8.2

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.1 has been released.


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

* [Bug c/54355] ICE on invalid code in switch statement
  2012-08-23  9:48 [Bug c/54355] New: ICE on invalid code in switch statement jay.foad at gmail dot com
                   ` (5 preceding siblings ...)
  2013-05-31 10:58 ` jakub at gcc dot gnu.org
@ 2013-10-16  9:51 ` jakub at gcc dot gnu.org
  2013-10-17 20:17 ` mpolacek at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-10-16  9:51 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.2                       |4.8.3

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.2 has been released.


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

* [Bug c/54355] ICE on invalid code in switch statement
  2012-08-23  9:48 [Bug c/54355] New: ICE on invalid code in switch statement jay.foad at gmail dot com
                   ` (6 preceding siblings ...)
  2013-10-16  9:51 ` jakub at gcc dot gnu.org
@ 2013-10-17 20:17 ` mpolacek at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-10-17 20:17 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |mpolacek at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed in 4.8/trunk, I don't think we want to backport it into 4.7.


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

end of thread, other threads:[~2013-10-17 20:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-23  9:48 [Bug c/54355] New: ICE on invalid code in switch statement jay.foad at gmail dot com
2012-08-23 11:22 ` [Bug c/54355] " jakub at gcc dot gnu.org
2012-08-23 11:24 ` jakub at gcc dot gnu.org
2012-08-23 11:57 ` jakub at gcc dot gnu.org
2012-08-24 21:45 ` jakub at gcc dot gnu.org
2013-03-22 14:43 ` jakub at gcc dot gnu.org
2013-05-31 10:58 ` jakub at gcc dot gnu.org
2013-10-16  9:51 ` jakub at gcc dot gnu.org
2013-10-17 20:17 ` mpolacek at gcc dot gnu.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).