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  <pola...@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

Reply via email to