[cfe-commits] [PATCH] Potential fix for PR9614

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Tue Oct 25 10:00:37 PDT 2011


Sorry for taking so long to reply.

> I don't know if we should use aliases to represent this property
> though.  Perhaps a cleaner solution would be to introduce a new
> Constant kind which represents a GlobalValue reference via an asm
> label.  For global variables and undefined and non-available_externally
> functions, this could constant fold to the GlobalValue itself.

This is probably the closest to what gcc does, but I kind like Eli's 
idea. We can add just a special case to clang:

* If a function would be emitted as available_externally, we are in gnu 
mode and the function would be a call to itself, we don't emit the 
avilable_externally definition at all, just a declaration.

What makes me consider this reasonable given the circumstances is that 
available_externally functions are supposed to have a matching 
definition somewhere else. In the cases found on the bugs, that is not 
true at all, the external definition in very different. What the hack 
would be doing in detecting case we know the code in lying to us.

>
> Thanks,

Cheers,
Rafael



More information about the cfe-commits mailing list