Hi Jason, I have made all the changes you mentioned and attached the new patch. Summary of the important things changed: * The versions are collected at declaration time itself now. * extern "C" functions are disallowed from being versions for now. extern "C" functions have to be handled exactly like how the C front-end would handle versioned functions. I will do this when I get to the C front-end. * Finalizing cgraph nodes is removed from front-end code. Thanks, -Sri. On Wed, Oct 31, 2012 at 7:02 AM, Jason Merrill wrote: > On 10/30/2012 05:49 PM, Sriraman Tallam wrote: >> >> AFAIU, this should not be a problem. For duplicate declarations, >> duplicate_decls should merge them and they should never be seen here. >> Did I miss something? > > > With extern "C" functions you can have multiple declarations of the same > function in different namespaces that are not duplicates, but still match. > And I can't think what that test is supposed to be catching, anyway. > > >> No, I thought about this but I did not want to handle this case in >> this iteration. The dispatcher is created only once and if more >> functions are declared later, they will not be dispatched atleast in >> this iteration. > > > I still think that instead of collecting the set of functions in overload > resolution, they should be collected at declaration time and added to a > vector in the cgraph information for use when generating the body of the > dispatcher. > > >> You talked about doing the dispatcher >> building later, but I did it here since I am doing it only once. > > > I still don't think this is the right place for it. > > >> dispatcher_node does not have a body until it is generated in >> cgraphunit.c, so cgraph does not mark this field before this is >> processed in cgraph_analyze_function. > > > That seems like something to address in your cgraph changes. > > Jason >