> -----Ursprüngliche Nachricht----- > Von: Gcc-help <gcc-help-bounces@xxxxxxxxxxx> Im Auftrag von Alexander > Monakov via Gcc-help > Gesendet: Donnerstag, 14. Januar 2021 16:10 > An: Fredrik Noring <noring@xxxxxxxxxx> > Cc: gcc-help@xxxxxxxxxxx; Segher Boessenkool > <segher@xxxxxxxxxxxxxxxxxxx>; Stefan Franke <s.franke@xxxxxxxxxxxx> > Betreff: Re: m68k: Simple loop compiles into boundless recursion with -O2 > > On Thu, 14 Jan 2021, Alexander Monakov via Gcc-help wrote: > > > 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#ind > > ex-optimize-function-attribute > > > > The optimize attribute should be used for debugging purposes only. It is > not > > suitable in production code. > > (part of the reason for that being that the interaction of the attribute with > options passed on the command line is poorly defined: currently adding the > attribute results in other -O and -f options dropped for the function, IIRC; this > should have gone out with the previous email, sorry about sending that > prematurely) Sorry, but I can't reproduce that 'dropping' of other options. I played around here: https://franke.ms/cex/z/EnK1GY Could you please provide a reproduceable example? Stefan