From 62b37d918eeaa7ce7ae292f4091c436fcb60f752 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Thu, 19 May 2005 19:17:49 +0000 Subject: [PATCH] tree-ssa-loop-ivopts.c (determine_base_object): Use build_fold_addr_expr to generate trees of correct type. 2005-05-19 Richard Guenther * tree-ssa-loop-ivopts.c (determine_base_object): Use build_fold_addr_expr to generate trees of correct type. Use fold_buildN if possible. From-SVN: r99981 --- gcc/ChangeLog | 6 ++++++ gcc/tree-ssa-loop-ivopts.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 51df4dc1950..81ea098ec56 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-05-19 Richard Guenther + + * tree-ssa-loop-ivopts.c (determine_base_object): Use + build_fold_addr_expr to generate trees of correct type. + Use fold_buildN if possible. + 2005-05-19 Jan Hubicka * basic-block.h (REG_BR_PROB_BASE): Define. diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index af121c4489d..f60082ab31a 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -791,7 +791,8 @@ determine_base_object (tree expr) if (TREE_CODE (base) == INDIRECT_REF) return determine_base_object (TREE_OPERAND (base, 0)); - return fold (build1 (ADDR_EXPR, ptr_type_node, base)); + return fold_convert (ptr_type_node, + build_fold_addr_expr (base)); case PLUS_EXPR: case MINUS_EXPR: @@ -804,9 +805,9 @@ determine_base_object (tree expr) if (!op0) return (code == PLUS_EXPR ? op1 - : fold (build1 (NEGATE_EXPR, ptr_type_node, op1))); + : fold_build1 (NEGATE_EXPR, ptr_type_node, op1)); - return fold (build (code, ptr_type_node, op0, op1)); + return fold_build2 (code, ptr_type_node, op0, op1); case NOP_EXPR: case CONVERT_EXPR: