This is the mail archive of the
mailing list for the GCC project.
Re: [patch] Fold x + x to x * 2
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 6 Nov 2004 21:23:32 +0000 (UTC)
- Subject: Re: [patch] Fold x + x to x * 2
- References: <20041106210123.GA8515@atrey.karlin.mff.cuni.cz>
On Sat, 6 Nov 2004, Zdenek Dvorak wrote:
> during investigation of PR 17549 I noted that we do not fold x + x to x
> * 2. We also do not fold x * c + x to x * (c + 1). (For non-floats.
> For floats we do both, under some assumptions.) In the case of PR
> 17549, the ivopts end up producing expressions of type x+x+...+x with as
> much as 8 operands (the expressions are then somehow folded in RTL
> optimizers, I think, so we do not end up producing these sums and it
> does not affect size of the final code, but still this behavior is quite
> weird). This patch implements these transformations.
Do you avoid eliminating -ftravp traps in the process? (E.g., x ==
230000000, c == -10, 32-bit signed integers, x * c overflows but x * (c +
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
email@example.com (personal mail)
firstname.lastname@example.org (CodeSourcery mail)
email@example.com (Bugzilla assignments and CCs)