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

Sriraman Tallam <tmsriram at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |davidxl at google dot com

--- Comment #2 from Sriraman Tallam <tmsriram at google dot com> ---
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.

Reply via email to