This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to control GCC builtin functions optimization
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.org/onlinedocs/gcc.pdf
Yes, I already have it and spent some time on it. It just a little bit
difficult for GCC newbie to find the answer accurately(I searched some
of the used flags).
>
> you are searching for:
> -mmemcpy
> -mno-memcpy
> Force (do not force) the use of memcpy for non-trivial block moves. The default
> is ‘-mno-memcpy’, which allows GCC to inline most constant-sized copies
I tried -mmemcpy, it seems these two are not for x86.
>
> and possibly for:
> -mmemcpy-strategy
>
> and
> -mstringop-strategy=alg
>
And yes, -mmemcpy-strategy worked as I expected.
Thanks very much!
--
Sincerely,
Cao jin