Re: Avoiding stack buffer clear being optimised out

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

 



On Tue, 24 Jan 2023 at 13:52, Jonny Grant <jg@xxxxxxxx> wrote:
>
> Probably other functions be "compiled out" like memset() is, would memcpy() be compiled out?

The compiler can do anything which does not change the observable side
effects of a valid program.

https://en.cppreference.com/w/cpp/language/as_if

So yes, the compiler can omit a memcpy that doesn't do anything. Or
any other function call that doesn't do anything.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux