[Bug tree-optimization/26524] [4.1 Regression] ICE when compiling with -ffast-math and -O3 clatm5.f (lapack)

roger at eyesopen dot com gcc-bugzilla@gcc.gnu.org
Thu Mar 2 21:39:00 GMT 2006



------- Comment #8 from roger at eyesopen dot com  2006-03-02 21:39 -------
I think I've found the problem.  On mainline, its in tree-scalar-evolution.c
at around line 1652, where where handle NEGATE_EXPR in
interpret_rhs_modify_expr.
The code checks whether the type is SCALAR_FLOAT_TYPE_P, in which case it uses
build_real, otherwise it calls build_int_cst_type.  Unfortunately, with a
complex
type, we end up generating a (const_int (complex4) -1) which is very broken.
I believe a suitable fix would be to replace this logic with something like
fold_convert (type, integer_minus_one_node), which will produce the correct
result for integers, reals and complex numbers.

My change to fold-const.c just has stricter error checking and refuses to
fold operations of mismatched types, and return NULL_TREE instead.  It wasn't
a fix, it just hid the problem which is still present but latent on mainline.

I think.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26524



More information about the Gcc-bugs mailing list