This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/23433] [4.1 Regression] ICE: tree check: expected real_cst, have integer_cst in const_binop, at fold-const.c:1512
- From: "sebastian dot pop at cri dot ensmp dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Aug 2005 23:23:50 -0000
- Subject: [Bug tree-optimization/23433] [4.1 Regression] ICE: tree check: expected real_cst, have integer_cst in const_binop, at fold-const.c:1512
- References: <20050817070754.23433.micis@gmx.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From sebastian dot pop at cri dot ensmp dot fr 2005-08-17 23:23 -------
Subject: Re: [4.1 Regression] ICE: tree check: expected real_cst, have integer_cst in const_binop, at fold-const.c:1512
I'm testing this patch on amd64 and i686. I will commit it once
validated.
Index: tree-chrec.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-chrec.c,v
retrieving revision 2.24
diff -d -u -p -r2.24 tree-chrec.c
--- tree-chrec.c 15 Aug 2005 12:26:07 -0000 2.24
+++ tree-chrec.c 17 Aug 2005 23:01:09 -0000
@@ -539,6 +539,9 @@ chrec_apply (unsigned var,
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "(chrec_apply \n");
+ if (TREE_CODE (x) == INTEGER_CST && SCALAR_FLOAT_TYPE_P (type))
+ x = build_real_from_int_cst (type, x);
+
if (evolution_function_is_affine_p (chrec))
{
/* "{a, +, b} (x)" -> "a + b*x". */
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23433