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



--- Comment #28 from Sriraman Tallam <tmsriram at google dot com> 2013-01-16 
17:25:21 UTC ---

(In reply to comment #25)

> The actual merging of target attribute isn't that important, what would be 
> more

> important is that other attributes are merged together in that case and the

> decls treated as the same thing.

> 

> Anyway, with target("any") attribute, what would happen for

> void foo () __attribute__((target ("avx")));

> void foo () __attribute__((target ("any")));

> void foo () {}

> Is the definition "any", something else?



Further, if we have these three declarations in this order:



void foo () __attribute__((target ("avx")));

void foo () __attribute__((target ("sse4.2")));

void foo () __attribute__((target ("any")));



This seems to mean that we want foo to be multi-versioned. However, when the

front-end is processing the second declaration, how would it decide between

merging or not without seeing the third? IMHO, I think each declaration should

be self-contained like Jakub proposed,  and by just looking at the declaration

we should be able to tell if the target attribute affects the signature or not.

Reply via email to