tree-ssa-loop-ivopts.c (determine_base_object): Use build_fold_addr_expr to generate trees of correct type.

2005-05-19  Richard Guenther  <rguenth@gcc.gnu.org>

	* 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
This commit is contained in:
Richard Guenther 2005-05-19 19:17:49 +00:00 committed by Richard Biener
parent 2e8a88f0b2
commit 62b37d918e
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2005-05-19 Richard Guenther <rguenth@gcc.gnu.org>
* 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 <jh@suse.cz>
* basic-block.h (REG_BR_PROB_BASE): Define.

View File

@ -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: