This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR58143 and dups
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, bernd dot edlinger at hotmail dot de
- Date: Thu, 17 Oct 2013 11:31:50 +0200 (CEST)
- Subject: Re: [PATCH] Fix PR58143 and dups
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LNX dot 2 dot 00 dot 1310151553140 dot 11149 at zhemvz dot fhfr dot qr> <alpine dot LNX dot 2 dot 00 dot 1310170947390 dot 11149 at zhemvz dot fhfr dot qr> <20131017080646 dot GB30970 at tucnak dot zalov dot cz>
On Thu, 17 Oct 2013, Jakub Jelinek wrote:
> On Thu, Oct 17, 2013 at 09:56:31AM +0200, Richard Biener wrote:
> > off-noise (more than 5s difference) may be 462.libquantum and
> > 459.GemsFDTD. I didn't include unpatched trunk in the comparison
> > (not fixing the bug isn't an option after all).
> > Conceptually I like the rewriting into unsigned arithmetic more
> > so I'm going to apply that variant later today (re-testing 3
> > runs of 462.libquantum and 459.GemsFDTD, this time with address-space
> > randomization turned off).
> Can't we rewrite for the selected arithmetic operations and punt (is that
> what Bernd's patch did) on moving other arithmetics? Well, there are
> operations that are safe even for signed types, e.g. rotates, isn't
> RSHIFT_EXPR also safe?
> Can't you handle also LSHIFT_EXPR (or do we treat it even signed as never
> undefined in the middle-end/backend?).
Sure, we can. I concentrated on fixing the cases that later cause
issues with aggressively treating the ops during niter analysis
which means ops that SCEV handles (see
But I'd rather have testcases here ...
Teaching LIM how to move conditional code would also be nice.
Btw, I don't think we'd lose many optimization opportunities if
we for example don't treat signed shifts or division as invoking
undefined behavior on overflow. All the overflow business is
important for loop optimizations and thus important only for
the cases that SCEV can handle ...