This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Don't ICE on invalid weak decl (PR middle-end/67330)


On 08/25/2015 09:44 AM, Marek Polacek wrote:
Here we are ICEing on an invalid code: symtab_node::get asserts that it's
dealing with a function or a static or external variable, but an invalid
decl is rejected too late.  So don't try to mark_weak an invalid decl and
also don't duplicate the "declared weak after being used" check -- that is
already in mark_weak.
Perhaps we should also punt if (!TARGET_SUPPORTS_WEAK)?

Bootstrapped/regtested on x86_64-linux, ok for trunk?

2015-08-25  Marek Polacek  <polacek@redhat.com>

	PR middle-end/67330
	* varasm.c (declare_weak): Return after giving an error.

	* c-common.c (handle_weak_attribute): Don't check whether the
	visibility can be changed here.

	* gcc.dg/weak/weak-18.c: New test.
OK.
jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]