This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/26524] [4.1 Regression] ICE when compiling with -ffast-math and -O3 clatm5.f (lapack)
- From: "roger at eyesopen dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Mar 2006 21:39:06 -0000
- Subject: [Bug tree-optimization/26524] [4.1 Regression] ICE when compiling with -ffast-math and -O3 clatm5.f (lapack)
- References: <bug-26524-11356@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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