public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39028]  New: C++ front-end rejects "__label__" at the beginning of a block after "for" and "while"
@ 2009-01-29 20:08 springl-gcc at bfw-online dot de
  2009-01-29 20:11 ` [Bug c++/39028] [4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: springl-gcc at bfw-online dot de @ 2009-01-29 20:08 UTC (permalink / raw)
  To: gcc-bugs

Trying to compile the c++ program label.C

void c ()
{ for (;;)   {__label__ l; goto l; l:;}
  while (1)  {__label__ l; goto l; l:;}
  if (1)     {__label__ l; goto l; l:;}
  do         {__label__ l; goto l; l:;} while (1);
             {__label__ l; goto l; l:;}
}

using
  g++ -Wall -Wextra   -c label.C
with g++ versions 4.4.0 20090129 (experimental) and 4.3.3 gives:

label.C: In function 'void c()':
label.C:2: error: '__label__' not at the beginning of a block
label.C:3: error: '__label__' not at the beginning of a block
label.C:3: error: duplicate label 'l'

The fix for bug 32121 "C++ front-end accepts invalid __label__
declarations" (svn revision 129253) moved handling __label__ declarations
to function cp_parser_compound_statement in gcc/cp/parser.c and omitted
it in function cp_parser_already_scoped_statement.  The newly introduced
tests cases only check the error case for while and for statements,
unfortunately.

Without any deeper understanding of gcc internals, I suggest two
possible fixes:

- copy the two lines handling __label__ declarations
from function cp_parser_compound_statement to function
cp_parser_already_scoped_statement, which might be the smallest change or
- merge part of cp_parser_already_scoped_statement's functionality to
cp_parser_compound_statement avoiding code duplication.


-- 
           Summary: C++ front-end rejects "__label__" at the beginning of a
                    block after "for" and "while"
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: springl-gcc at bfw-online dot de
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug c++/39028] [4.3/4.4 Regression] C++ front-end rejects "__label__" at the beginning of a block after "for" and "while"
  2009-01-29 20:08 [Bug c++/39028] New: C++ front-end rejects "__label__" at the beginning of a block after "for" and "while" springl-gcc at bfw-online dot de
@ 2009-01-29 20:11 ` pinskia at gcc dot gnu dot org
  2009-01-30 12:00 ` jakub at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-29 20:11 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
           Keywords|                            |rejects-valid
            Summary|C++ front-end rejects       |[4.3/4.4 Regression] C++
                   |"__label__" at the beginning|front-end rejects
                   |of a block after "for" and  |"__label__" at the beginning
                   |"while"                     |of a block after "for" and
                   |                            |"while"
   Target Milestone|---                         |4.3.4


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


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

* [Bug c++/39028] [4.3/4.4 Regression] C++ front-end rejects "__label__" at the beginning of a block after "for" and "while"
  2009-01-29 20:08 [Bug c++/39028] New: C++ front-end rejects "__label__" at the beginning of a block after "for" and "while" springl-gcc at bfw-online dot de
  2009-01-29 20:11 ` [Bug c++/39028] [4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
@ 2009-01-30 12:00 ` jakub at gcc dot gnu dot org
  2009-01-30 16:18 ` jakub at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-30 12:00 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-01-30 12:00:49
               date|                            |


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


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

* [Bug c++/39028] [4.3 Regression] C++ front-end rejects "__label__" at the beginning of a block after "for" and "while"
  2009-01-29 20:08 [Bug c++/39028] New: C++ front-end rejects "__label__" at the beginning of a block after "for" and "while" springl-gcc at bfw-online dot de
                   ` (2 preceding siblings ...)
  2009-01-30 16:18 ` jakub at gcc dot gnu dot org
@ 2009-01-30 16:18 ` jakub at gcc dot gnu dot org
  2009-02-21 13:16 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-30 16:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2009-01-30 16:18 -------
Fixed on the trunk so far.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.3/4.4 Regression] C++    |[4.3 Regression] C++ front-
                   |front-end rejects           |end rejects "__label__" at
                   |"__label__" at the beginning|the beginning of a block
                   |of a block after "for" and  |after "for" and "while"
                   |"while"                     |


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


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

* [Bug c++/39028] [4.3/4.4 Regression] C++ front-end rejects "__label__" at the beginning of a block after "for" and "while"
  2009-01-29 20:08 [Bug c++/39028] New: C++ front-end rejects "__label__" at the beginning of a block after "for" and "while" springl-gcc at bfw-online dot de
  2009-01-29 20:11 ` [Bug c++/39028] [4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
  2009-01-30 12:00 ` jakub at gcc dot gnu dot org
@ 2009-01-30 16:18 ` jakub at gcc dot gnu dot org
  2009-01-30 16:18 ` [Bug c++/39028] [4.3 " jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-30 16:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jakub at gcc dot gnu dot org  2009-01-30 16:17 -------
Subject: Bug 39028

Author: jakub
Date: Fri Jan 30 16:17:30 2009
New Revision: 143797

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143797
Log:
        PR c++/39028
        * parser.c (cp_parser_already_scoped_statement): Handle __label__
        declarations.

        * g++.dg/ext/label12.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/ext/label12.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/39028] [4.3 Regression] C++ front-end rejects "__label__" at the beginning of a block after "for" and "while"
  2009-01-29 20:08 [Bug c++/39028] New: C++ front-end rejects "__label__" at the beginning of a block after "for" and "while" springl-gcc at bfw-online dot de
                   ` (3 preceding siblings ...)
  2009-01-30 16:18 ` [Bug c++/39028] [4.3 " jakub at gcc dot gnu dot org
@ 2009-02-21 13:16 ` rguenth at gcc dot gnu dot org
  2009-03-13 22:57 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-02-21 13:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2009-02-21 13:16 -------
In which gcc version did this work?


-- 


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


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

* [Bug c++/39028] [4.3 Regression] C++ front-end rejects "__label__" at the beginning of a block after "for" and "while"
  2009-01-29 20:08 [Bug c++/39028] New: C++ front-end rejects "__label__" at the beginning of a block after "for" and "while" springl-gcc at bfw-online dot de
                   ` (4 preceding siblings ...)
  2009-02-21 13:16 ` rguenth at gcc dot gnu dot org
@ 2009-03-13 22:57 ` rguenth at gcc dot gnu dot org
  2009-08-04 12:47 ` rguenth at gcc dot gnu dot org
  2010-05-22 18:29 ` rguenth at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-03-13 22:57 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.3.3
      Known to work|                            |4.2.4 4.4.0
           Priority|P3                          |P2


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


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

* [Bug c++/39028] [4.3 Regression] C++ front-end rejects "__label__" at the beginning of a block after "for" and "while"
  2009-01-29 20:08 [Bug c++/39028] New: C++ front-end rejects "__label__" at the beginning of a block after "for" and "while" springl-gcc at bfw-online dot de
                   ` (5 preceding siblings ...)
  2009-03-13 22:57 ` rguenth at gcc dot gnu dot org
@ 2009-08-04 12:47 ` rguenth at gcc dot gnu dot org
  2010-05-22 18:29 ` rguenth at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-08-04 12:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2009-08-04 12:29 -------
GCC 4.3.4 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.4                       |4.3.5


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


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

* [Bug c++/39028] [4.3 Regression] C++ front-end rejects "__label__" at the beginning of a block after "for" and "while"
  2009-01-29 20:08 [Bug c++/39028] New: C++ front-end rejects "__label__" at the beginning of a block after "for" and "while" springl-gcc at bfw-online dot de
                   ` (6 preceding siblings ...)
  2009-08-04 12:47 ` rguenth at gcc dot gnu dot org
@ 2010-05-22 18:29 ` rguenth at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-22 18:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2010-05-22 18:13 -------
GCC 4.3.5 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.5                       |4.3.6


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


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

end of thread, other threads:[~2010-05-22 18:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-29 20:08 [Bug c++/39028] New: C++ front-end rejects "__label__" at the beginning of a block after "for" and "while" springl-gcc at bfw-online dot de
2009-01-29 20:11 ` [Bug c++/39028] [4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
2009-01-30 12:00 ` jakub at gcc dot gnu dot org
2009-01-30 16:18 ` jakub at gcc dot gnu dot org
2009-01-30 16:18 ` [Bug c++/39028] [4.3 " jakub at gcc dot gnu dot org
2009-02-21 13:16 ` rguenth at gcc dot gnu dot org
2009-03-13 22:57 ` rguenth at gcc dot gnu dot org
2009-08-04 12:47 ` rguenth at gcc dot gnu dot org
2010-05-22 18:29 ` rguenth 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).