From def49dd7ca01bdeea7cf61c90da4206609e65ce5 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Wed, 9 Jan 2008 14:17:13 +0000 Subject: re PR tree-optimization/34458 (ICE in int_cst_value, at tree.c:8047 at -O3) 2008-01-09 Richard Guenther PR middle-end/34458 * tree-data-ref.c (initialize_matrix_A): Use tree_low_cst, adjust return type. * gcc.c-torture/compile/pr34458.c: New testcase. From-SVN: r131429 --- gcc/tree-data-ref.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'gcc/tree-data-ref.c') diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index 88f6347..e4ac89a 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -1820,15 +1820,24 @@ analyze_siv_subscript_cst_affine (tree chrec_a, /* Helper recursive function for initializing the matrix A. Returns the initial value of CHREC. */ -static int +static HOST_WIDE_INT initialize_matrix_A (lambda_matrix A, tree chrec, unsigned index, int mult) { + tree type; + gcc_assert (chrec); + type = TREE_TYPE (chrec); if (TREE_CODE (chrec) != POLYNOMIAL_CHREC) - return int_cst_value (chrec); - - A[index][0] = mult * int_cst_value (CHREC_RIGHT (chrec)); + return tree_low_cst (chrec, TYPE_UNSIGNED (type) + && !(TREE_CODE (type) == INTEGER_TYPE + && TYPE_IS_SIZETYPE (type))); + + type = TREE_TYPE (CHREC_RIGHT (chrec)); + A[index][0] = mult * tree_low_cst (CHREC_RIGHT (chrec), + TYPE_UNSIGNED (type) + && !(TREE_CODE (type) == INTEGER_TYPE + && TYPE_IS_SIZETYPE (type))); return initialize_matrix_A (A, CHREC_LEFT (chrec), index + 1, mult); } -- cgit v1.1