PR tree-optimization/47190: ICE on weakref missing alias info

Richard Guenther rguenther@suse.de
Mon Jan 24 15:22:00 GMT 2011


On Mon, 24 Jan 2011, Jan Hubicka wrote:

> > On Sat, 22 Jan 2011, Jan Hubicka wrote:
> > 
> > > Hi,
> > > this PR shows ICE on invalid
> > > static int i __attribute__ ((weakref));
> > > 
> > > according to docs, weakref attribute should be accompanied with an alias.
> > > This patch adds checking into cgraphunit.c.
> > > 
> > > Bootstrapped/regtested x86_64-linux, OK?
> > 
> > It's bad this is not possible in c-common when building the
> > weakref attribute.  Can't we simply ignore weakref without
> > alias?  That would be a tiny bit cleaner than verifying
> > attributes from cgraph ...
> Docs explicitly shows the testcase:
> static int x() __attribute__ ((weakref));
> static int x() __attribute__ ((alias ("y")));
> 
> I think whatever we do during parsing would refuse the first declaration.
> 
> Since we do this attribute finalization there anyway, I don't think it is that bad.

Any reason we can't ignore non-aliased weakrefs at uses?

Richard.



More information about the Gcc-patches mailing list