On 11/05/13 10:13, bin.cheng wrote:
Index: gcc/tree-affine.c
===================================================================
--- gcc/tree-affine.c (revision 204117)
+++ gcc/tree-affine.c (working copy)
@@ -874,10 +874,11 @@ debug_aff (aff_tree *val)
fprintf (stderr, "\n");
}
-/* Returns address of the reference REF in ADDR. The size of the accessed
- location is stored to SIZE. */
+/* Computes address of the reference REF in ADDR. The size of the accessed
+ location is stored to SIZE. Returns pointer to the ultimate containing
+ object to which REF refers. */
-void
+tree
get_inner_reference_aff (tree ref, aff_tree *addr, double_int *size)
{
HOST_WIDE_INT bitsize, bitpos;
@@ -904,6 +905,8 @@ get_inner_reference_aff (tree ref, aff_tree *addr,
aff_combination_add (addr,&tmp);
*size = double_int::from_shwi ((bitsize + BITS_PER_UNIT - 1) /
BITS_PER_UNIT);
+
+ return base_addr;
}
I think what Richard suggests is to return the base object rather the
address of the base object, i.e.
return base;
This is good in keeping the consistency in the return values between
get_inner_reference_aff and get_inner_reference.
Yufeng