This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/32417] [4.3 Regression] 416.gamess ICEs
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jun 2007 00:36:03 -0000
- Subject: [Bug middle-end/32417] [4.3 Regression] 416.gamess ICEs
- References: <bug-32417-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from pinskia at gcc dot gnu dot org 2007-06-22 00:36 -------
Here is the patch which fixes this testcase (note IV-OPTS is still messed up
but I will work on that later):
Index: tree-affine.c
===================================================================
--- tree-affine.c (revision 125927)
+++ tree-affine.c (working copy)
@@ -130,6 +130,7 @@
aff_combination_add_elt (aff_tree *comb, tree elt, double_int scale)
{
unsigned i;
+ tree type;
scale = double_int_ext_for_comb (scale, comb);
if (double_int_zero_p (scale))
@@ -169,17 +170,26 @@
return;
}
+ type = comb->type;
+ if (POINTER_TYPE_P (type))
+ type = sizetype;
+
if (double_int_one_p (scale))
- elt = fold_convert (comb->type, elt);
+ elt = fold_convert (type, elt);
else
- elt = fold_build2 (MULT_EXPR, comb->type,
- fold_convert (comb->type, elt),
- double_int_to_tree (comb->type, scale));
+ elt = fold_build2 (MULT_EXPR, type,
+ fold_convert (type, elt),
+ double_int_to_tree (type, scale));
if (comb->rest)
- comb->rest = fold_build2 (PLUS_EXPR, comb->type, comb->rest, elt);
+ {
+ if (!POINTER_TYPE_P (comb->type))
+ comb->rest = fold_build2 (PLUS_EXPR, comb->type, comb->rest, elt);
+ else
+ comb->rest = fold_build2 (POINTER_PLUS_EXPR, comb->type, comb->rest,
elt);
+ }
else
- comb->rest = elt;
+ comb->rest = fold_convert (comb->type, elt);
}
/* Adds CST to C. */
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32417