> -----Ursprüngliche Nachricht----- > Von: Gcc-help <gcc-help-bounces@xxxxxxxxxxx> Im Auftrag von Segher > Boessenkool > Gesendet: Mittwoch, 13. Januar 2021 22:46 > An: Fredrik Noring <noring@xxxxxxxxxx> > Cc: gcc-help@xxxxxxxxxxx; Alexander Monakov <amonakov@xxxxxxxxx> > Betreff: Re: m68k: Simple loop compiles into boundless recursion with -O2 > > On Wed, Jan 13, 2021 at 08:53:13PM +0100, Fredrik Noring wrote: > > > For the archives, no one has said it yet: to just disable the > > > optimisation transforming the loop into a memset, you can use > > > -fno-tree-loop-distribute-patterns . > > > > It's a new 32-bit libc (for Atari TOS), and maximum GCC optimisations > > are welcome, although I haven't yet figured out exactly where the > > boundary is between the GCC built-ins and this libc implementation. > > There is obviously some overlap between the two, and I wouldn't want > > the libc to stand in the way of GCC's optimisations. > > You would use this flag only for compiling the memset (etc.) routines > themselves. Maybe using a pragma or similar. > > > Segher e.g. this one: __attribute__((optimize("no-tree-loop-distribute-patterns"))) void *memset2(void *s, int c, unsigned int n) { ... Stefan