This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix -Wimplicit-fallthrough ICE (PR c/77946)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Bernd Schmidt <bschmidt at redhat dot com>
- Cc: Marek Polacek <polacek at redhat dot com>, Jason Merrill <jason at redhat dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 13 Oct 2016 12:20:24 +0200
- Subject: Re: [PATCH] Fix -Wimplicit-fallthrough ICE (PR c/77946)
- Authentication-results: sourceware.org; auth=none
- References: <20161012232522.GY7282@tucnak.redhat.com> <c7494aa6-de84-0bca-96f6-c321bcdbb6bc@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Oct 13, 2016 at 12:11:36PM +0200, Bernd Schmidt wrote:
> On 10/13/2016 01:25 AM, Jakub Jelinek wrote:
> >Seems 2 functions in varasm.c just use TREE_PUBLIC on LABEL_DECLs together
> >with other kinds of decls, but as TREE_PUBLIC on LABEL_DECLs means now
> >something different, it breaks badly.
>
> Which functions are these?
The ones I've noticed were:
bool
default_binds_local_p_3 (const_tree exp, bool shlib, bool weak_dominate,
bool extern_protected_data, bool common_local_p)
{
/* A non-decl is an entry in the constant pool. */
if (!DECL_P (exp))
return true;
...
/* Static variables are always local. */
if (! TREE_PUBLIC (exp))
return true;
...
}
bool
decl_binds_to_current_def_p (const_tree decl)
{
gcc_assert (DECL_P (decl));
if (!targetm.binds_local_p (decl))
return false;
if (!TREE_PUBLIC (decl))
return true;
...
}
both relied on TREE_PUBLIC be actually false for LABEL_DECLs, because
otherwise they have code later on that can't handle LABE_DECLs (plus callers
also not expecting LABEL_DECLs might not bind locally or might not bind to
the current def.
Jakub