[Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
--- 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
[Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
-- 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
[Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
-- mmitchel at gcc dot gnu dot org changed: What|Removed |Added Priority|P3 |P2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30786
[Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
--- 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
[Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
--- 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
[Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
-- 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
[Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
--- 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
[Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
--- 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
[Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
--- 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
[Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file
--- 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