[PATCH]: Fix ICE in PRE

Daniel Berlin dberlin@dberlin.org
Wed May 18 01:50:00 GMT 2005


Falk Hueffner pointed this out to me on IRC (so there is no bug report
for it).

Because PRE now can optimize pure and const calls, when you use -O2
-ffast-math, it is going to remove the cos call along the d = 0 path.

double f(double d, double i, int j) { if (j == 1) d = 0; return d *
cos(i); }


In doing so, it needs to regenerate the d *  cos expression in the other
branch, and find_or_generate_expression was ICE'ing because it hadn't
been updated to know that it can generate CALL_EXPR :).

Fixed thusly.


Bootstrapped and currently being regtested on i686-pc-linux-gnu (except
java, which fails to build for me both with and without the patch).
I'll commit this to mainline once it finishes regtesting.

--Dan




-------------- next part --------------
A non-text attachment was scrubbed...
Name: prediff.diff
Type: text/x-patch
Size: 1468 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050518/cf5edeea/attachment.bin>


More information about the Gcc-patches mailing list