+2007-03-28 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-dfa.c (get_ref_base_and_extent): Do not expect positive
+ offsets for BIT_FIELD_REF and COMPONENT_REF.
+
2007-03-28 Richard Guenther <rguenther@suse.de>
* tree.c (is_global_var): Move ...
--- /dev/null
+with System;
+
+package Thin_Pointer is
+
+ type Stream is array (Integer range <>) of Character;
+
+ type Stream_Ptr is access Stream;
+ for Stream_Ptr'Size use Standard'Address_Size;
+
+ type Buf is record
+ A : System.Address;
+ end record;
+
+ type Buf_Wrapper is record
+ B : Buf;
+ end record;
+
+ type Buf_Ptr is access Buf_Wrapper;
+
+ procedure Set_Buffer (AD : Buf_Ptr; Buffer : Stream_ptr);
+
+end Thin_Pointer;
switch (TREE_CODE (exp))
{
case BIT_FIELD_REF:
- bit_offset += tree_low_cst (TREE_OPERAND (exp, 2), 1);
+ bit_offset += tree_low_cst (TREE_OPERAND (exp, 2), 0);
break;
case COMPONENT_REF:
if (this_offset && TREE_CODE (this_offset) == INTEGER_CST)
{
- HOST_WIDE_INT hthis_offset = tree_low_cst (this_offset, 1);
+ HOST_WIDE_INT hthis_offset = tree_low_cst (this_offset, 0);
hthis_offset *= BITS_PER_UNIT;
bit_offset += hthis_offset;
- bit_offset += tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 1);
+ bit_offset += tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 0);
}
else
{
/* We need to adjust maxsize to the whole structure bitsize.
But we can subtract any constant offset seen sofar,
because that would get us out of the structure otherwise. */
- if (maxsize != -1
- && csize && host_integerp (csize, 1))
- {
- maxsize = (TREE_INT_CST_LOW (csize) - bit_offset);
- }
+ if (maxsize != -1 && csize && host_integerp (csize, 1))
+ maxsize = TREE_INT_CST_LOW (csize) - bit_offset;
else
maxsize = -1;
}
/* We need to adjust maxsize to the whole array bitsize.
But we can subtract any constant offset seen sofar,
because that would get us outside of the array otherwise. */
- if (maxsize != -1
- && asize && host_integerp (asize, 1))
- {
- maxsize = (TREE_INT_CST_LOW (asize) - bit_offset);
- }
+ if (maxsize != -1 && asize && host_integerp (asize, 1))
+ maxsize = TREE_INT_CST_LOW (asize) - bit_offset;
else
maxsize = -1;