]> git.ipfire.org Git - thirdparty/gcc.git/commit
fold-const.c (fold <PLUS_EXPR>): Transform x+x into x*2.0.
authorRoger Sayle <roger@eyesopen.com>
Mon, 4 Aug 2003 23:42:48 +0000 (23:42 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Mon, 4 Aug 2003 23:42:48 +0000 (23:42 +0000)
commitf2593a6649384b002184762c58b083eb5f8e939f
tree9617a20782252283684d9c8639c9ad8e7fbf7873
parent29019803327d246f686bcc22d9d95b0e3cdc244d
fold-const.c (fold <PLUS_EXPR>): Transform x+x into x*2.0.

* fold-const.c (fold <PLUS_EXPR>): Transform x+x into x*2.0.
Optimize x*c+x and x+x*c into x*(c+1) and x*c1+x*c2 into x*(c1+c2)
for floating point expressions with -ffast-math.
(fold <MULT_EXPR>): Don't transform x*2.0 into x+x.
* expmed.c (expand_mult): Wrap long line.  Expand x*2.0 as x+x.

* gcc.dg/20030804-1.c: New test case.

From-SVN: r70158
gcc/ChangeLog
gcc/expmed.c
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20030804-1.c [new file with mode: 0644]