[Bug c++/81721] precompiled header : internal compiler error: Segmentation fault
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81721 Andrew Pinski changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED Target Milestone|--- |10.0 --- Comment #10 from Andrew Pinski --- Fixed.
[Bug c++/81721] precompiled header : internal compiler error: Segmentation fault
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81721 --- Comment #9 from Andrew Pinski --- Author: pinskia Date: Mon May 20 06:59:06 2019 New Revision: 271395 URL: https://gcc.gnu.org/viewcvs?rev=271395=gcc=rev Log: [PATCH] Fix PR 81721: ICE with PCH and Pragma warning and C++ operator libcpp/ChangeLog: 2019-05-19 Andrew Pinski PR pch/81721 * lex.c (cpp_token_val_index ): If tok->flags has NAMED_OP set, then return CPP_TOKEN_FLD_NODE. gcc/testsuite/ChangeLog: 2019-05-19 Andrew Pinski PR pch/81721 * g++.dg/pch/operator-1.C: New testcase. * g++.dg/pch/operator-1.Hs: New file. Added: trunk/gcc/testsuite/g++.dg/pch/operator-1.C trunk/gcc/testsuite/g++.dg/pch/operator-1.Hs Modified: trunk/gcc/testsuite/ChangeLog trunk/libcpp/ChangeLog trunk/libcpp/lex.c
[Bug c++/81721] precompiled header : internal compiler error: Segmentation fault
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81721 Andrew Pinski changed: What|Removed |Added Keywords||patch URL||https://gcc.gnu.org/ml/gcc- ||patches/2019-04/msg00055.ht ||ml --- Comment #8 from Andrew Pinski --- Patch submitted (even with the simple testcase): https://gcc.gnu.org/ml/gcc-patches/2019-04/msg00055.html
[Bug c++/81721] precompiled header : internal compiler error: Segmentation fault
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81721 --- Comment #7 from Andrew Pinski --- Here is a much simplier testcase (without using system header files): a.h: # define __glibc_macro_warning1(message) _Pragma (#message) # define __glibc_macro_warning(message) \ __glibc_macro_warning1 (GCC warning message) #define __SYSMACROS_DM1(...) __glibc_macro_warning (#__VA_ARGS__) #define __SYSMACROS_DM(symbol) __SYSMACROS_DM1 \ (Did not Work) # define major(dev) __SYSMACROS_DM (major) (dev+0) CUT --- a.c: #include "a.h" int main(void){ major(0);} CUT I will submit a patch for this soon.
[Bug c++/81721] precompiled header : internal compiler error: Segmentation fault
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81721 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2019-04-01 Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #6 from Andrew Pinski --- Created attachment 46071 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46071=edit New patch Turns out the fix is simple. If we have a SPELL_OPERATOR where the flags is set NAMED_OP, then we need say node needs to be walked for PCH to keep around.
[Bug c++/81721] precompiled header : internal compiler error: Segmentation fault
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81721 --- Comment #5 from Andrew Pinski --- So if I understand the token->val.node.spelling for "not" (CPP_NOT) is not being preserved over the precompiled headers.
[Bug c++/81721] precompiled header : internal compiler error: Segmentation fault
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81721 Eric Gallager changed: What|Removed |Added CC||bonzini at gnu dot org, ||geoffk at gcc dot gnu.org, ||jsm28 at gcc dot gnu.org --- Comment #4 from Eric Gallager --- (In reply to Juro Bystricky from comment #0) > > After some debugging, I found the segmentation fault was caused in > libcpp/lex.c (cpp_spell_token): > > case SPELL_IDENT: > if (forstring) > { > memcpy (buffer, NODE_NAME (token->val.node.spelling), >NODE_LEN (token->val.node.spelling)); > buffer += NODE_LEN (token->val.node.spelling); > } > svn blame for that part shows: 82199bonzini case SPELL_IDENT: 96333 geoffk if (forstring) 96333 geoffk { 217202 jsm28 memcpy (buffer, NODE_NAME (token->val.node.spelling), 217202 jsm28 NODE_LEN (token->val.node.spelling)); 217202 jsm28 buffer += NODE_LEN (token->val.node.spelling); 96333 geoffk } cc-ing them.
[Bug c++/81721] precompiled header : internal compiler error: Segmentation fault
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81721 Eric Gallager changed: What|Removed |Added CC||egallager at gcc dot gnu.org --- Comment #3 from Eric Gallager --- (In reply to Juro Bystricky from comment #2) > This patch fixes the issue: > http://lists.openembedded.org/pipermail/openembedded-core/2017-August/140486.html patches go to the gcc-patches mailing list
[Bug c++/81721] precompiled header : internal compiler error: Segmentation fault
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81721 Juro Bystricky changed: What|Removed |Added CC||juro.bystricky at intel dot com --- Comment #2 from Juro Bystricky --- This patch fixes the issue: http://lists.openembedded.org/pipermail/openembedded-core/2017-August/140486.html
[Bug c++/81721] precompiled header : internal compiler error: Segmentation fault
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81721 --- Comment #1 from Juro Bystricky --- This patch fixes the issue: http://lists.openembedded.org/pipermail/openembedded-core/2017-August/140486.html