OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2011-08-23 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git]
/
gcc
/
tree-ssa-address.c
diff --git
a/gcc/tree-ssa-address.c
b/gcc/tree-ssa-address.c
index
c6dced1
..
34479b3
100644
(file)
--- a/
gcc/tree-ssa-address.c
+++ b/
gcc/tree-ssa-address.c
@@
-279,7
+279,8
@@
tree_mem_ref_addr (tree type, tree mem_ref)
if (act_elem)
{
if (step)
if (act_elem)
{
if (step)
- act_elem = fold_build2 (MULT_EXPR, sizetype, act_elem, step);
+ act_elem = fold_build2 (MULT_EXPR, TREE_TYPE (act_elem),
+ act_elem, step);
addr_off = act_elem;
}
addr_off = act_elem;
}
@@
-287,22
+288,23
@@
tree_mem_ref_addr (tree type, tree mem_ref)
if (act_elem)
{
if (addr_off)
if (act_elem)
{
if (addr_off)
- addr_off = fold_build2 (PLUS_EXPR, sizetype, addr_off, act_elem);
+ addr_off = fold_build2 (PLUS_EXPR, TREE_TYPE (addr_off),
+ addr_off, act_elem);
else
addr_off = act_elem;
}
if (offset && !integer_zerop (offset))
{
else
addr_off = act_elem;
}
if (offset && !integer_zerop (offset))
{
- offset = fold_convert (sizetype, offset);
if (addr_off)
if (addr_off)
- addr_off = fold_build2 (PLUS_EXPR, sizetype, addr_off, offset);
+ addr_off = fold_build2 (PLUS_EXPR, TREE_TYPE (addr_off), addr_off,
+ fold_convert (TREE_TYPE (addr_off), offset));
else
addr_off = offset;
}
if (addr_off)
else
addr_off = offset;
}
if (addr_off)
- addr = fold_build
2 (POINTER_PLUS_EXPR, type,
addr_base, addr_off);
+ addr = fold_build
_pointer_plus (
addr_base, addr_off);
else
addr = addr_base;
else
addr = addr_base;
@@
-521,9
+523,7
@@
add_to_parts (struct mem_address *parts, tree elt)
/* Add ELT to base. */
type = TREE_TYPE (parts->base);
if (POINTER_TYPE_P (type))
/* Add ELT to base. */
type = TREE_TYPE (parts->base);
if (POINTER_TYPE_P (type))
- parts->base = fold_build2 (POINTER_PLUS_EXPR, type,
- parts->base,
- fold_convert (sizetype, elt));
+ parts->base = fold_build_pointer_plus (parts->base, elt);
else
parts->base = fold_build2 (PLUS_EXPR, type,
parts->base, elt);
else
parts->base = fold_build2 (PLUS_EXPR, type,
parts->base, elt);
@@
-692,7
+692,6
@@
create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
tree alias_ptr_type, tree iv_cand, tree base_hint, bool speed)
{
tree mem_ref, tmp;
tree alias_ptr_type, tree iv_cand, tree base_hint, bool speed)
{
tree mem_ref, tmp;
- tree atype;
struct mem_address parts;
addr_to_parts (type, addr, iv_cand, base_hint, &parts, speed);
struct mem_address parts;
addr_to_parts (type, addr, iv_cand, base_hint, &parts, speed);
@@
-731,11
+730,8
@@
create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
if (parts.index)
{
if (parts.index)
{
- atype = TREE_TYPE (tmp);
parts.base = force_gimple_operand_gsi_1 (gsi,
parts.base = force_gimple_operand_gsi_1 (gsi,
- fold_build2 (POINTER_PLUS_EXPR, atype,
- tmp,
- fold_convert (sizetype, parts.base)),
+ fold_build_pointer_plus (tmp, parts.base),
is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
}
else
is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
}
else
@@
-758,11
+754,8
@@
create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
/* Add index to base. */
if (parts.base)
{
/* Add index to base. */
if (parts.base)
{
- atype = TREE_TYPE (parts.base);
parts.base = force_gimple_operand_gsi_1 (gsi,
parts.base = force_gimple_operand_gsi_1 (gsi,
- fold_build2 (POINTER_PLUS_EXPR, atype,
- parts.base,
- parts.index),
+ fold_build_pointer_plus (parts.base, parts.index),
is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
}
else
is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
}
else
@@
-779,11
+772,8
@@
create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
/* Try adding offset to base. */
if (parts.base)
{
/* Try adding offset to base. */
if (parts.base)
{
- atype = TREE_TYPE (parts.base);
parts.base = force_gimple_operand_gsi_1 (gsi,
parts.base = force_gimple_operand_gsi_1 (gsi,
- fold_build2 (POINTER_PLUS_EXPR, atype,
- parts.base,
- fold_convert (sizetype, parts.offset)),
+ fold_build_pointer_plus (parts.base, parts.offset),
is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
}
else
is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
}
else