On Thu, 14 Jan 2021, Fredrik Noring wrote: > > __attribute__((optimize("no-tree-loop-distribute-patterns"))) > > void *memset2(void *s, int c, unsigned int n) > > { > > ... > > This works, too, and I prefer it because the __attribute__ is attached > to the code itself. Just keep in mind that this attribute is currently not intended for use apart from debugging/testing: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-optimize-function-attribute The optimize attribute should be used for debugging purposes only. It is not suitable in production code. Alexander