From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BEDB53858281; Tue, 31 Oct 2023 17:14:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BEDB53858281 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698772452; bh=3Rfiu2zSk6VSJzPtYQNeXgxjUYven96uiARVd8rAnj0=; h=From:To:Subject:Date:From; b=O/Hlj+2dJmZAkAuB2iPZwP3jzpwZtqqQ3qAbcZIqh3gfhXR76u5KyV/uc5jj9npX9 kNXjwUGe9GWV0oBx/otVmr7fsH+qV08tmt3QWhJj4tAxvkPUMZJrs3LyCQaE+gln5r vbc4aLeBrKb6A4hP0kYEBatlOmzb0qYcrLIVEMMo= From: "krebbel at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug pch/112319] New: segfault with pch and #pragma GCC diagnostic Date: Tue, 31 Oct 2023 17:14:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: pch X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: krebbel at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112319 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 /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 in= t) /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 for instructions. Can be reproduced on x86 and s390x since: e664ea960a200aac88ffc3c7fb9fe55ea4df2011 is the first bad commit=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 commit e664ea960a200aac88ffc3c7fb9fe55ea4df2011=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 Author: Lewis Hyatt =20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20 Date: Fri Jun 30 18:23:24 2023 -0400=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20 c-family: Implement pragma_lex () for preprocess-only mode=