+2009-11-23 Richard Guenther <rguenther@suse.de>
+
+ * tree-dfa.c (get_ref_base_and_extent): Adjust maximum access
+ size for DECL bases.
+
2009-11-22 Richard Henderson <rth@redhat.com>
* i386.c (avx_vpermilp_parallel): New function.
the array. The simplest way to conservatively deal with this
is to punt in the case that offset + maxsize reaches the
base type boundary. This needs to include possible trailing padding
- that is there for alignment purposes. */
+ that is there for alignment purposes.
- if (seen_variable_array_ref
- && maxsize != -1
- && (!host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1)
- || (bit_offset + maxsize
- == (signed) TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (exp))))))
+ That is of course only true if the base object is not a decl. */
+
+ if (DECL_P (exp))
+ {
+ /* If maxsize is unknown adjust it according to the size of the
+ base decl. */
+ if (maxsize == -1
+ && host_integerp (DECL_SIZE (exp), 1))
+ maxsize = TREE_INT_CST_LOW (DECL_SIZE (exp)) - bit_offset;
+ }
+ else if (seen_variable_array_ref
+ && maxsize != -1
+ && (!host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1)
+ || (bit_offset + maxsize
+ == (signed) TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (exp))))))
maxsize = -1;
/* ??? Due to negative offsets in ARRAY_REF we can end up with