public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jamborm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61433] [4.9/4.10 Regression] ICE: SIGSEGV in friend_accessible_p (search.c:778) with -std=gnu++11 -O -fcompare-debug -fno-inline -fno-ipa-pure-const -fipa-sra Date: Thu, 26 Jun 2014 16:35:00 -0000 [thread overview] Message-ID: <bug-61433-4-xVZmFY8HXg@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-61433-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61433 Martin Jambor <jamborm at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #3 from Martin Jambor <jamborm at gcc dot gnu.org> --- (In reply to Richard Biener from comment #2) > Hmm, -compare-debug not working is bad. Martin, can you have a look? Well, the C++ front-end crashes when DECL_LANG_SPECIFIC is cleared on clones. We started doing this in Jakub's revision r207465 which fixed PR 60002. So if this is OK (and since Jason approved of it in that PR, I assume it is), the front-end needs to be aware of this. I do not know it well enough to propose anything more clever than the following (so far untested) patch. However, DECL_LANG_SPECIFIC is accessed by many macros in cp-tree.h so issues like these are likely to continue popping up. diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 424b26c..cc77d8f 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -775,7 +775,13 @@ friend_accessible_p (tree scope, tree decl, tree binfo) return 0; if (DECL_DECLARES_FUNCTION_P (scope)) - befriending_classes = DECL_BEFRIENDING_CLASSES (scope); + { + if (DECL_ABSTRACT_ORIGIN (scope)) + befriending_classes = DECL_BEFRIENDING_CLASSES + (DECL_ABSTRACT_ORIGIN (scope)); + else + befriending_classes = DECL_BEFRIENDING_CLASSES (scope); + } else if (TYPE_P (scope)) befriending_classes = CLASSTYPE_BEFRIENDING_CLASSES (scope); else @@ -800,6 +806,9 @@ friend_accessible_p (tree scope, tree decl, tree binfo) && friend_accessible_p (DECL_CONTEXT (scope), decl, binfo)) return 1; + if (DECL_ABSTRACT_ORIGIN (scope)) + scope = DECL_ABSTRACT_ORIGIN (scope); + /* Or an instantiation of something which is a friend. */ if (DECL_TEMPLATE_INFO (scope)) {
next prev parent reply other threads:[~2014-06-26 16:35 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-06-06 20:33 [Bug c++/61433] New: " zsojka at seznam dot cz 2014-06-10 10:13 ` [Bug c++/61433] " rguenth at gcc dot gnu.org 2014-06-25 12:59 ` jakub at gcc dot gnu.org 2014-06-26 12:46 ` rguenth at gcc dot gnu.org 2014-06-26 16:35 ` jamborm at gcc dot gnu.org [this message] 2014-06-27 4:05 ` jason at gcc dot gnu.org 2014-06-27 21:39 ` jason at gcc dot gnu.org 2014-06-28 3:46 ` jason at gcc dot gnu.org 2014-06-28 3:46 ` jason at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-61433-4-xVZmFY8HXg@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).