AW: m68k: Simple loop compiles into boundless recursion with -O2

Stefan Franke s.franke@bebbosoft.de
Thu Jan 14 15:15:41 GMT 2021


> -----Ursprüngliche Nachricht-----
> Von: Gcc-help <gcc-help-bounces@gcc.gnu.org> Im Auftrag von Alexander
> Monakov via Gcc-help
> Gesendet: Donnerstag, 14. Januar 2021 16:10
> An: Fredrik Noring <noring@nocrew.org>
> Cc: gcc-help@gcc.gnu.org; Segher Boessenkool
> <segher@kernel.crashing.org>; Stefan Franke <s.franke@bebbosoft.de>
> 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



More information about the Gcc-help mailing list