public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "ktietz at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/35330] [4.8/4.9/5 regression] ICE with invalid pragma weak Date: Thu, 26 Feb 2015 18:22:00 -0000 [thread overview] Message-ID: <bug-35330-4-rEmBbFq1V0@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-35330-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35330 --- Comment #12 from Kai Tietz <ktietz at gcc dot gnu.org> --- issue seems to be that in declare_weak we don't check that DECL is actually either a function, or a variable declaration. Fix would be to add an error-message in declare_weak (). Index: varasm.c =================================================================== @@ -5398,6 +5399,12 @@ void declare_weak (tree decl) { gcc_assert (TREE_CODE (decl) != FUNCTION_DECL || !TREE_ASM_WRITTEN (decl)); + if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL) + { + error ("weak declaration of %q+D has to be either a function," + " or a variable declaration", decl); + return; + } if (! TREE_PUBLIC (decl)) error ("weak declaration of %q+D must be public", decl); else if (!TARGET_SUPPORTS_WEAK)
next prev parent reply other threads:[~2015-02-26 17:23 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-35330-4@http.gcc.gnu.org/bugzilla/> 2011-06-27 14:39 ` [Bug c/35330] [4.3/4.4/4.5/4.6/4.7 " rguenth at gcc dot gnu.org 2012-03-13 15:05 ` [Bug c/35330] [4.5/4.6/4.7/4.8 " jakub at gcc dot gnu.org 2012-07-02 13:21 ` [Bug c/35330] [4.6/4.7/4.8 " rguenth at gcc dot gnu.org 2013-04-12 15:18 ` [Bug c/35330] [4.7/4.8/4.9 " jakub at gcc dot gnu.org 2014-06-12 13:48 ` [Bug c/35330] [4.7/4.8/4.9/4.10 " rguenth at gcc dot gnu.org 2014-12-19 13:33 ` [Bug c/35330] [4.8/4.9/5 " jakub at gcc dot gnu.org 2015-02-26 18:16 ` ktietz at gcc dot gnu.org 2015-02-26 18:22 ` ktietz at gcc dot gnu.org [this message] 2015-02-27 11:29 ` ktietz at gcc dot gnu.org 2015-02-27 11:33 ` ktietz 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-35330-4-rEmBbFq1V0@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).