https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71991

--- Comment #10 from Jan Hubicka <hubicka at ucw dot cz> ---
> > Well, I have tried to discuss this on IRC couple times but we got no
> > conclusion what to do here. I think I will simply go with the proposed patch
> > + additional hack to ignore arch mismatches when callee has no explicit
> > target attribute?
> 
> Or we can reject that and fix the affected packages if you believe it's just
> hack. Eventually one can remove the problematic always_inline attribute.

Well, in theory, it is all lazyness on the side of gcc - of course one can in
theory track ISA attributes at instruction granuality and make all those
inlines safe. But of course this is becuase optimize/target attributes are
hacks by themselves.

The proposed patch is consistent with hacks we already have in ipa-inline

      /* When user added an attribute to the callee honor it.  */               
      else if (lookup_attribute ("optimize", DECL_ATTRIBUTES (callee->decl))    
               && opts_for_fn (caller->decl) != opts_for_fn (callee->decl))     

It may not be that easy to fix these at user side - for example current logic
will block you from using xmmintrin.h functions from any function with custom
target attribute specifying ISA flags, which I think was one of original
motivations
for those.

Reply via email to