Is there a way to use __builtin___memcpy_chk() for compiler-generated memcpy calls?
Segher Boessenkool
segher@kernel.crashing.org
Fri Jan 19 22:48:56 GMT 2024
On Wed, Jan 17, 2024 at 11:23:25AM +0000, Dallman, John via Gcc-help wrote:
> Florian Weimer <fweimer@redhat.com> wrote:
>
> > > a) Struct copying, with memcpy calls inserted by the compiler.
> > GCC will also optimize __memcpy_chk calls to memcpy if it knows that
> > the bounds cannot be wrong.
>
> Is there a way to stop it doing that? Yes, I am anticipating a high level of paranoia on the part of my customers.
You can edit the code to do anything irrational you want :-)
Segher
More information about the Gcc-help
mailing list