aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-dfa.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2007-03-28 20:11:20 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2007-03-28 20:11:20 +0000
commit8975ae2285b74f05a4465e7a9c8c0bdf8cf300b1 (patch)
tree5b3ea977e0d89e228ad35e4d140ae606fd436493 /gcc/tree-dfa.c
parent7fc100eb8166f32898842a823d58343e9149a8c6 (diff)
downloadgcc-8975ae2285b74f05a4465e7a9c8c0bdf8cf300b1.zip
gcc-8975ae2285b74f05a4465e7a9c8c0bdf8cf300b1.tar.gz
gcc-8975ae2285b74f05a4465e7a9c8c0bdf8cf300b1.tar.bz2
tree-dfa.c (get_ref_base_and_extent): Do not expect positive offsets for BIT_FIELD_REF and COMPONENT_REF.
* tree-dfa.c (get_ref_base_and_extent): Do not expect positive offsets for BIT_FIELD_REF and COMPONENT_REF. From-SVN: r123311
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r--gcc/tree-dfa.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index b23c531..70563e7 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -896,7 +896,7 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
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:
@@ -906,11 +906,11 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
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
{
@@ -918,11 +918,8 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
/* 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;
}
@@ -959,11 +956,8 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
/* 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;