[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/alternatives: Force inline stac() and clac()



>>> Andrew Cooper <andrew.cooper3@xxxxxxxxxx> 08/18/14 6:16 PM >>>
>In this case, we know better than the compiler.
>
>gcc 4.7 (Debian Wheezy) chooses to create translation-unit-local functions
>(even for non-debug builds) named stac() and clac(), and calls them.
>
>$ objdump -d xen-syms | grep -c "<stac>:"
>6
>
>$ objdump -d xen-syms | grep -o "callq  [0-9a-f]\+ <stac>" | uniq -c
      >5 callq  ffff82d0801166c9 <stac>
     >20 callq  ffff82d08015ef99 <stac>
      >4 callq  ffff82d080165169 <stac>
      >8 callq  ffff82d080188cb9 <stac>
      >3 callq  ffff82d080228779 <stac>
      >4 callq  ffff82d08022c5c9 <stac>
>
>Forcing always_inline removes these functions, and replaces each of the callqs
>with the expected 3byte nops.

I'm fine putting the patch in, but isn't this a compiler bug? Creating a 5-byte
call instruction instead of a 3-byte inline expansion should even preclude out
of line placement under -Os (which otherwise is the most likely reason for
functions not getting inlined).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.