------- Additional Comments From reichelt at gcc dot gnu dot org  2005-08-01 
23:58 -------
The ICE seems to happen when a floating point number is decremented.
The following code snippet in add_to_evolution looks suspicious:

  if (code == MINUS_EXPR)
    to_add = chrec_fold_multiply (type, to_add, 
                                  build_int_cst_type (type, -1));

This leads to trouble if type is a REAL_TYPE.

The following patch (neither bootstrapped nor regtested) seems to fix
the problem (also in PR23173). Is this a proper fix?

===================================================================
--- tree-scalar-evolution.c     27 Jul 2005 13:26:54 -0000      2.32
+++ tree-scalar-evolution.c     1 Aug 2005 23:43:59 -0000
@@ -237,6 +237,7 @@ Software Foundation, 51 Franklin Street,
 #include "tm.h"
 #include "ggc.h"
 #include "tree.h"
+#include "real.h"
 
 /* These RTL headers are needed for basic-block.h.  */
 #include "rtl.h"
@@ -866,8 +867,9 @@ add_to_evolution (unsigned loop_nb, 
     }
 
   if (code == MINUS_EXPR)
-    to_add = chrec_fold_multiply (type, to_add, 
-                                 build_int_cst_type (type, -1));
+    to_add = chrec_fold_multiply (type, to_add, TREE_CODE (type) == REAL_TYPE
+                                 ? build_real (type, dconstm1)
+                                 : build_int_cst_type (type, -1));
 
   res = add_to_evolution_1 (loop_nb, chrec_before, to_add);
 
===================================================================


-- 


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

Reply via email to