public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug pch/112319] New: segfault with pch and #pragma GCC diagnostic
@ 2023-10-31 17:14 krebbel at gcc dot gnu.org
  2023-10-31 17:58 ` [Bug pch/112319] " lhyatt at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: krebbel at gcc dot gnu.org @ 2023-10-31 17:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112319

            Bug ID: 112319
           Summary: segfault with pch and #pragma GCC diagnostic
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: pch
          Assignee: unassigned at gcc dot gnu.org
          Reporter: krebbel at gcc dot gnu.org
  Target Milestone: ---

touch s.h
touch u.h

main.cpp:
#include "s.h"
#include "u.h"

g++ s.h
g++ -c main.cpp --save-temps
In file included from main.cpp:2:
u.h:1:9: internal compiler error: Segmentation fault
    1 | #pragma GCC diagnostic
      |         ^~~
0x1764fbf crash_signal
        /home/andreas/build/../gcc/gcc/toplev.cc:314
0x10201cd maybe_read_tokens_for_pragma_lex
        /home/andreas/build/../gcc/gcc/cp/parser.cc:49713
0x10201cd pragma_lex(tree_node**, unsigned int*)
        /home/andreas/build/../gcc/gcc/cp/parser.cc:49735
0x11a962c pragma_diagnostic_lex
        /home/andreas/build/../gcc/gcc/c-family/c-pragma.cc:851
0x11a9d78 handle_pragma_diagnostic_impl<true, true>
        /home/andreas/build/../gcc/gcc/c-family/c-pragma.cc:879
0x11a9d78 handle_pragma_diagnostic_early_pp
        /home/andreas/build/../gcc/gcc/c-family/c-pragma.cc:1039
0x11abdbd c_pp_invoke_early_pragma_handler(unsigned int)
        /home/andreas/build/../gcc/gcc/c-family/c-pragma.cc:1769
0x11a8180 token_streamer::stream(cpp_reader*, cpp_token const*, unsigned int)
        /home/andreas/build/../gcc/gcc/c-family/c-ppoutput.cc:293
0x11a8461 scan_translation_unit
        /home/andreas/build/../gcc/gcc/c-family/c-ppoutput.cc:351
0x11a8461 preprocess_file(cpp_reader*)
        /home/andreas/build/../gcc/gcc/c-family/c-ppoutput.cc:106
0x11a693d c_common_init()
        /home/andreas/build/../gcc/gcc/c-family/c-opts.cc:1236
0xfa35be cxx_init()
        /home/andreas/build/../gcc/gcc/cp/lex.cc:338
0xe94153 lang_dependent_init
        /home/andreas/build/../gcc/gcc/toplev.cc:1816
0xe94153 do_compile
        /home/andreas/build/../gcc/gcc/toplev.cc:2111
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Can be reproduced on x86 and s390x since:

e664ea960a200aac88ffc3c7fb9fe55ea4df2011 is the first bad commit                
commit e664ea960a200aac88ffc3c7fb9fe55ea4df2011                                 
Author: Lewis Hyatt <lhyatt@gmail.com>                                          
Date:   Fri Jun 30 18:23:24 2023 -0400                                          

    c-family: Implement pragma_lex () for preprocess-only mode

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

end of thread, other threads:[~2023-11-24 21:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-31 17:14 [Bug pch/112319] New: segfault with pch and #pragma GCC diagnostic krebbel at gcc dot gnu.org
2023-10-31 17:58 ` [Bug pch/112319] " lhyatt at gcc dot gnu.org
2023-10-31 17:58 ` [Bug pch/112319] [14 Regression] " pinskia at gcc dot gnu.org
2023-11-01 21:56 ` lhyatt at gcc dot gnu.org
2023-11-02  8:29 ` rguenth at gcc dot gnu.org
2023-11-24 21:26 ` cvs-commit at gcc dot gnu.org
2023-11-24 21:27 ` lhyatt 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).