From 16a2acea0aca10ade467f2e15bde2bc956d6528e Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Mon, 3 Apr 2006 11:59:38 +0200 Subject: re PR tree-optimization/26992 (Internal Compiler Error in dwarf2out.c:7607 build_polynomial_chrec) PR bootstrap/26992 * tree-scalar-evolution.c (compute_overall_effect_of_inner_loop, chrec_is_positive, set_nb_iterations_in_loop): Use a variable for the type of nb_iter. (instantiate_parameters_1): Convert the operands before calling chrec_fold_minus, chrec_fold_plus, or chrec_fold_multiply. * tree-data-ref.c (can_use_analyze_subscript_affine_affine): Same. From-SVN: r112635 --- gcc/tree-data-ref.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'gcc/tree-data-ref.c') diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index 1421e7d..30b491b 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -3035,15 +3035,18 @@ end_analyze_subs_aa: static bool can_use_analyze_subscript_affine_affine (tree *chrec_a, tree *chrec_b) { - tree diff; + tree diff, type, left_a, left_b, right_b; if (chrec_contains_symbols (CHREC_RIGHT (*chrec_a)) || chrec_contains_symbols (CHREC_RIGHT (*chrec_b))) /* FIXME: For the moment not handled. Might be refined later. */ return false; - diff = chrec_fold_minus (chrec_type (*chrec_a), CHREC_LEFT (*chrec_a), - CHREC_LEFT (*chrec_b)); + type = chrec_type (*chrec_a); + left_a = CHREC_LEFT (*chrec_a); + left_b = chrec_convert (type, CHREC_LEFT (*chrec_b), NULL_TREE); + diff = chrec_fold_minus (type, left_a, left_b); + if (!evolution_function_is_constant_p (diff)) return false; @@ -3052,9 +3055,10 @@ can_use_analyze_subscript_affine_affine (tree *chrec_a, tree *chrec_b) *chrec_a = build_polynomial_chrec (CHREC_VARIABLE (*chrec_a), diff, CHREC_RIGHT (*chrec_a)); + right_b = chrec_convert (type, CHREC_RIGHT (*chrec_b), NULL_TREE); *chrec_b = build_polynomial_chrec (CHREC_VARIABLE (*chrec_b), - integer_zero_node, - CHREC_RIGHT (*chrec_b)); + convert (type, integer_zero_node), + right_b); return true; } -- cgit v1.1