This is the mail archive of the
mailing list for the GCC project.
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: Andi Kleen <ak at muc dot de>
- Cc: dje at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Sat, 1 Jan 2005 13:18:16 +0100
- Subject: Re: -funsafe-loop-optimizations
- References: <20041231211409.GA22814@atrey.karlin.mff.cuni.cz> <firstname.lastname@example.org>
> > several times some people sounded opinion that in addition to improving
> > analyses in loop optimizer, we might also add a flag that would enable
> > the compiler to assume that the compiled code does not contain loops
> > behaving in "weird" way (loops whose control induction variables
> > overflows, infinite loops with nontrivial exit conditions).
> > I remember several people were against this possibility. Therefore
> > I send the proposal for the patch implementing this flag first here
> > to the gcc list, to give the chance to discuss about it before I try
> > to test and submit it properly (or not).
> It would be nicer/safer to have this as a per loop pragma. This would
> allow to only enable it when the programmer knows it is true for a specific
> loop, without risking breaking inline code in C library includes etc.
> Most other compilers seem to have pragmas like this. For unrolling
> it would be useful too.
> Unfortunately it seems to be non trivial to pass such attributes through
> the tree-ssa passes :/
I am still more and more persuaded that information about loops should
be preserved through all tree-ssa optimization passes (which should be
possible with minor adjustments; I think only dom jump threading may
still clobber loop structures, once loop-aware cfg cleanup is in),
and also through rtl optimization passes at least till loop optimizer
(preferably till modulo scheduler as well). This would make the pragma
idea feasible (among other advantages).