This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR tree-optimization/47190: ICE on weakref missing alias info
On Mon, 24 Jan 2011, Jan Hubicka wrote:
> > > The ICE is about fact that we drop WEAK flag on static var:
> > >
> > > if (lookup_attribute ("alias", DECL_ATTRIBUTES (*node)))
> > > error_at (DECL_SOURCE_LOCATION (*node),
> > > "weakref attribute must appear before alias attribute");
> > >
> > > /* Can't call declare_weak because it wants this to be TREE_PUBLIC,
> > > and that isn't supported; and because it wants to add it to
> > > the list of weak decls, which isn't helpful. */
> > > DECL_WEAK (*node) = 1;
> > >
> > > and my sanity check declares it as nonsential that it indeed is.
> > > So if we want to define that weakref alone is no-op (normal static var), we can
> > > just keep the code removing WEAK flag I added and remove the error.
> >
> > Yes, I like that more.
>
> Why we want to silently accept use of attribute that has no effect? (and makes no
> sense?). I can only imagine this to be result of not understanding what weakref
> means.
Then it should be a warning, certainly not an error.
Richard.