public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/30786] New: ICE on _Pragma at end of file
@ 2007-02-13 14:23 truedfx at gentoo dot org
2007-02-13 15:55 ` [Bug preprocessor/30786] " tromey at gcc dot gnu dot org
` (13 more replies)
0 siblings, 14 replies; 15+ messages in thread
From: truedfx at gentoo dot org @ 2007-02-13 14:23 UTC (permalink / raw)
To: gcc-bugs
Compiling or preprocessing a file that ends immediately after _Pragma leads to
an ICE:
<bug.c>:1:1: error: _Pragma takes a parenthesized string literal
<built-in>:0: internal compiler error: Segmentation fault
Simply `echo _Pragma | cpp` is enough to show it.
I'm using gcc 4.1.1.
--
Summary: ICE on _Pragma at end of file
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: truedfx at gentoo dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug preprocessor/30786] ICE on _Pragma at end of file
2007-02-13 14:23 [Bug preprocessor/30786] New: ICE on _Pragma at end of file truedfx at gentoo dot org
@ 2007-02-13 15:55 ` tromey at gcc dot gnu dot org
2007-02-16 2:03 ` [Bug preprocessor/30786] [4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-02-13 15:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from tromey at gcc dot gnu dot org 2007-02-13 15:55 -------
Confirmed, with svn head and the FC6 gcc 4.1.
--
tromey at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-02-13 15:55:12
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
2007-02-13 14:23 [Bug preprocessor/30786] New: ICE on _Pragma at end of file truedfx at gentoo dot org
2007-02-13 15:55 ` [Bug preprocessor/30786] " tromey at gcc dot gnu dot org
@ 2007-02-16 2:03 ` pinskia at gcc dot gnu dot org
2007-02-19 21:08 ` mmitchel at gcc dot gnu dot org
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-16 2:03 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-invalid-code
Known to fail| |3.4.0 4.0.3 4.1.0 4.2.0
Known to work| |3.3.3
Summary|ICE on _Pragma at end of |[4.1/4.2/4.3 Regression] ICE
|file |on _Pragma at end of file
Target Milestone|--- |4.1.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
2007-02-13 14:23 [Bug preprocessor/30786] New: ICE on _Pragma at end of file truedfx at gentoo dot org
2007-02-13 15:55 ` [Bug preprocessor/30786] " tromey at gcc dot gnu dot org
2007-02-16 2:03 ` [Bug preprocessor/30786] [4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2007-02-19 21:08 ` mmitchel at gcc dot gnu dot org
2007-04-16 19:11 ` bonzini at gnu dot org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-19 21:08 UTC (permalink / raw)
To: gcc-bugs
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
2007-02-13 14:23 [Bug preprocessor/30786] New: ICE on _Pragma at end of file truedfx at gentoo dot org
` (2 preceding siblings ...)
2007-02-19 21:08 ` mmitchel at gcc dot gnu dot org
@ 2007-04-16 19:11 ` bonzini at gnu dot org
2007-04-16 19:24 ` bonzini at gnu dot org
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: bonzini at gnu dot org @ 2007-04-16 19:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from bonzini at gnu dot org 2007-04-16 20:11 -------
Created an attachment (id=13372)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13372&action=view)
patch to fix part of the bug
This patch seems to fix the preprocessor side of the bug. However there are
problems later in the C parser.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
2007-02-13 14:23 [Bug preprocessor/30786] New: ICE on _Pragma at end of file truedfx at gentoo dot org
` (3 preceding siblings ...)
2007-04-16 19:11 ` bonzini at gnu dot org
@ 2007-04-16 19:24 ` bonzini at gnu dot org
2007-08-06 15:08 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: bonzini at gnu dot org @ 2007-04-16 19:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from bonzini at gnu dot org 2007-04-16 20:24 -------
Created an attachment (id=13373)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13373&action=view)
patch to fix part of the bug
By fixing the preprocessor part better, we can fix the bug completely.
However, I don't have time now to prepare a proper patch (and test it
properly).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
2007-02-13 14:23 [Bug preprocessor/30786] New: ICE on _Pragma at end of file truedfx at gentoo dot org
` (4 preceding siblings ...)
2007-04-16 19:24 ` bonzini at gnu dot org
@ 2007-08-06 15:08 ` pinskia at gcc dot gnu dot org
2007-08-19 16:13 ` tromey 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 @ 2007-08-06 15:08 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
Keywords| |error-recovery
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
2007-02-13 14:23 [Bug preprocessor/30786] New: ICE on _Pragma at end of file truedfx at gentoo dot org
` (5 preceding siblings ...)
2007-08-06 15:08 ` pinskia at gcc dot gnu dot org
@ 2007-08-19 16:13 ` tromey at gcc dot gnu dot org
2007-08-19 18:19 ` tromey at gcc dot gnu dot org
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-08-19 16:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from tromey at gcc dot gnu dot org 2007-08-19 16:13 -------
I'm testing this patch.
--
tromey at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |tromey at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2007-02-13 15:55:12 |2007-08-19 16:13:10
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
2007-02-13 14:23 [Bug preprocessor/30786] New: ICE on _Pragma at end of file truedfx at gentoo dot org
` (6 preceding siblings ...)
2007-08-19 16:13 ` tromey at gcc dot gnu dot org
@ 2007-08-19 18:19 ` tromey at gcc dot gnu dot org
2007-08-19 18:55 ` tromey at gcc dot gnu dot org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-08-19 18:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from tromey at gcc dot gnu dot org 2007-08-19 18:19 -------
A program like '_Pragma /*comment*/' still gives an ICE.
I'm testing an updated patch.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
2007-02-13 14:23 [Bug preprocessor/30786] New: ICE on _Pragma at end of file truedfx at gentoo dot org
` (7 preceding siblings ...)
2007-08-19 18:19 ` tromey at gcc dot gnu dot org
@ 2007-08-19 18:55 ` tromey at gcc dot gnu dot org
2007-08-25 18:42 ` tromey at gcc dot gnu dot org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-08-19 18:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from tromey at gcc dot gnu dot org 2007-08-19 18:54 -------
What does a plain "_Pragma" mean?
Currently we try to give an error for this. However, it is not clear that
this is actually erroneous. The copy of the standard that I am reading
only mentions:
A unary operator expression of the form:
_Pragma ( string-literal )
... but a plain _Pragma does not have that form.
I'm not even sure that _Pragma(something-other-than-string-literal)
should be recognized (but I'm new to C standardese...)
Perhaps I have the wrong version of the standard or perhaps there
is some more recent development of which I'm unaware.
Anyway if we assume that a plain _Pragma is not an error then the first
patch here is close to the correct one -- it just returns the plain
_Pragma to the FE as an identifier. If all forms other than the
full form are unrecognized then I think this first patch is correct.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
2007-02-13 14:23 [Bug preprocessor/30786] New: ICE on _Pragma at end of file truedfx at gentoo dot org
` (8 preceding siblings ...)
2007-08-19 18:55 ` tromey at gcc dot gnu dot org
@ 2007-08-25 18:42 ` tromey at gcc dot gnu dot org
2007-10-31 14:50 ` tromey at gcc dot gnu dot org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-08-25 18:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from tromey at gcc dot gnu dot org 2007-08-25 18:42 -------
FYI -- I talked to Neil and he was of the opinion that non-matching
_Pragma forms were undefined. So, I think it is best if GCC chooses
to continue giving an error in these situations.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
2007-02-13 14:23 [Bug preprocessor/30786] New: ICE on _Pragma at end of file truedfx at gentoo dot org
` (9 preceding siblings ...)
2007-08-25 18:42 ` tromey at gcc dot gnu dot org
@ 2007-10-31 14:50 ` tromey at gcc dot gnu dot org
2007-11-01 18:28 ` [Bug preprocessor/30786] [4.1/4.2 " jakub at gcc dot gnu dot org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-10-31 14:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from tromey at gcc dot gnu dot org 2007-10-31 14:50 -------
Subject: Bug 30786
Author: tromey
Date: Wed Oct 31 14:50:13 2007
New Revision: 129800
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129800
Log:
gcc/testsuite
PR preprocessor/30786:
* gcc.dg/cpp/pr30786.c: New file.
libcpp
PR preprocessor/30786:
* macro.c (builtin_macro): Return result of _cpp_do__Pragma.
* directives.c (_cpp_do__Pragma): Return error status.
* internal.h (_cpp_do__Pragma): Update.
* directives.c (get__Pragma_string): Back up if EOF seen.
Added:
trunk/gcc/testsuite/gcc.dg/cpp/pr30786.c
Modified:
trunk/gcc/testsuite/ChangeLog
trunk/libcpp/ChangeLog
trunk/libcpp/directives.c
trunk/libcpp/internal.h
trunk/libcpp/macro.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug preprocessor/30786] [4.1/4.2 Regression] ICE on _Pragma at end of file
2007-02-13 14:23 [Bug preprocessor/30786] New: ICE on _Pragma at end of file truedfx at gentoo dot org
` (10 preceding siblings ...)
2007-10-31 14:50 ` tromey at gcc dot gnu dot org
@ 2007-11-01 18:28 ` jakub at gcc dot gnu dot org
2008-07-04 21:57 ` [Bug preprocessor/30786] [4.2 " jsm28 at gcc dot gnu dot org
2009-03-30 21:33 ` jsm28 at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-01 18:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from jakub at gcc dot gnu dot org 2007-11-01 18:28 -------
Fixed on the trunk.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work|3.3.3 |3.3.3 4.3.0
Summary|[4.1/4.2/4.3 Regression] ICE|[4.1/4.2 Regression] ICE on
|on _Pragma at end of file |_Pragma at end of file
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug preprocessor/30786] [4.2 Regression] ICE on _Pragma at end of file
2007-02-13 14:23 [Bug preprocessor/30786] New: ICE on _Pragma at end of file truedfx at gentoo dot org
` (11 preceding siblings ...)
2007-11-01 18:28 ` [Bug preprocessor/30786] [4.1/4.2 " jakub at gcc dot gnu dot org
@ 2008-07-04 21:57 ` jsm28 at gcc dot gnu dot org
2009-03-30 21:33 ` jsm28 at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 21:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from jsm28 at gcc dot gnu dot org 2008-07-04 21:56 -------
Closing 4.1 branch.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.1/4.2 Regression] ICE on |[4.2 Regression] ICE on
|_Pragma at end of file |_Pragma at end of file
Target Milestone|4.1.3 |4.2.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug preprocessor/30786] [4.2 Regression] ICE on _Pragma at end of file
2007-02-13 14:23 [Bug preprocessor/30786] New: ICE on _Pragma at end of file truedfx at gentoo dot org
` (12 preceding siblings ...)
2008-07-04 21:57 ` [Bug preprocessor/30786] [4.2 " jsm28 at gcc dot gnu dot org
@ 2009-03-30 21:33 ` jsm28 at gcc dot gnu dot org
13 siblings, 0 replies; 15+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-30 21:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from jsm28 at gcc dot gnu dot org 2009-03-30 21:33 -------
Closing 4.2 branch, fixed in 4.3.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Known to fail|3.4.0 4.0.3 4.1.0 4.2.0 |3.4.0 4.0.3 4.1.0 4.2.0
| |4.2.5
Resolution| |FIXED
Target Milestone|4.2.5 |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2009-03-30 21:33 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-13 14:23 [Bug preprocessor/30786] New: ICE on _Pragma at end of file truedfx at gentoo dot org
2007-02-13 15:55 ` [Bug preprocessor/30786] " tromey at gcc dot gnu dot org
2007-02-16 2:03 ` [Bug preprocessor/30786] [4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
2007-02-19 21:08 ` mmitchel at gcc dot gnu dot org
2007-04-16 19:11 ` bonzini at gnu dot org
2007-04-16 19:24 ` bonzini at gnu dot org
2007-08-06 15:08 ` pinskia at gcc dot gnu dot org
2007-08-19 16:13 ` tromey at gcc dot gnu dot org
2007-08-19 18:19 ` tromey at gcc dot gnu dot org
2007-08-19 18:55 ` tromey at gcc dot gnu dot org
2007-08-25 18:42 ` tromey at gcc dot gnu dot org
2007-10-31 14:50 ` tromey at gcc dot gnu dot org
2007-11-01 18:28 ` [Bug preprocessor/30786] [4.1/4.2 " jakub at gcc dot gnu dot org
2008-07-04 21:57 ` [Bug preprocessor/30786] [4.2 " jsm28 at gcc dot gnu dot org
2009-03-30 21:33 ` jsm28 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).