[Bug c++/57378] gnu multiversioning gives assembler error: foo.resolver is already defined

davidxl at google dot com gcc-bugzilla@gcc.gnu.org
Thu May 23 19:40:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57378

--- Comment #3 from davidxl at google dot com ---

Can the resolver node be updated? or a new dispatcher/resolver is created?

The user code looks fine to me, which exposes the implementation limitation.

David

(In reply to Sriraman Tallam from comment #2)
> First, what is happening here is the first call to foo is only seeing 2
> versions and the second call to foo is seeing the 3rd corei7 version. Was
> this intentional?  
> 
> When the dispatcher/resovler decl is created, the cgraph nodes of all
> versions are mapped to this decl. However, the new version decl (corei7
> version) is created later, after the first call, and hence it is not mapped
> to the dispatcher function decl that was previously generated. Hence the
> second call re-generates it.
> 
> There are a couple of issues here. Should the first call to foo () even get
> access to the corei7 version which is not visible? If the corei7 version
> should not be visible to the first call I must create 2 resolvers, one for
> the first call and the other for the second call.  This gets complicated and
> I want to leave this for future enhancement.
> 
> Currently, what is supported is that all calls must see all the versions
> that will be created. I can create a patch to generate an appropriate error
> here  so that this is made clear.



More information about the Gcc-bugs mailing list