[patch] (-fstrict-overflow) optimize counted loops on signed iv

Ian Lance Taylor iant@google.com
Wed Feb 14 16:17:00 GMT 2007


"Richard Guenther" <richard.guenther@gmail.com> writes:

> > Another minor change in this patch is the addition of
> > FLAG_OVERFLOW_UNDEFINED to avoid testing the overflow flags for each
> > type like in :
> >
> >    if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (op0))
> >      || TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (op1)))
> >        return false;
> 
> That doesn't work unless you want to make unsigned overflow undefined as well.

I think it works in the way that he uses it, but I think it's a bad
idea because it will be error-prone.  And it's a micro-optimization
which should be unnecessary: there won't be any stores between
accesses to the global variables, so the compiler should not need to
load them twice.

Christian, can you test your patch without that change?

Ian



More information about the Gcc-patches mailing list