How to control GCC builtin functions optimization

2019-01-10 Thread Cao jin
Hi, (pls CC me when replying because I am not subscriber) I met an interesting phenomenon when looking into linux kernel compilation, it can be simply summarized as following: in arch/x86/boot/compressed, memcpy is defined as __builtin_memcpy, while also implemented as a function. But when using m

Re: How to control GCC builtin functions optimization

2019-01-11 Thread Martin Liška
On 1/11/19 4:03 AM, Cao jin wrote: > Now the questions is: from code-reading, it is kind of non-intuitive, is > there any explicit way to control the optimization behavior accurately? Hi. Please take a look here: https://gcc.gnu.org/onlinedocs/gcc.pdf you are searching for: -mmemcpy -mno-memcpy

Re: How to control GCC builtin functions optimization

2019-01-11 Thread Cao jin
Hi Martin, On 1/11/19 5:22 PM, Martin Liška wrote: > On 1/11/19 4:03 AM, Cao jin wrote: >> Now the questions is: from code-reading, it is kind of non-intuitive, is >> there any explicit way to control the optimization behavior accurately? > > Hi. > > Please take a look here: > https://gcc.gnu.or

Re: How to control GCC builtin functions optimization

2019-01-11 Thread Cao jin
On 1/11/19 7:09 PM, Cao jin wrote: > Hi Martin, >> >> and possibly for: >> -mmemcpy-strategy >> >> and >> -mstringop-strategy=alg >> > > And yes, -mmemcpy-strategy worked as I expected. typo. It is -mstringop-strategy=byte_loop -- Sincerely, Cao jin