aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2008-11-03 19:55:54 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-11-03 19:55:54 +0000
commit2d8d91a8404e26f124d16cc91ff08291bd700c1b (patch)
tree91e5bdac25132fe31844daa7243769913efcad05 /gcc/tree-sra.c
parente73da78efc08838680dee919a4eb060d2f8c78dd (diff)
downloadgcc-2d8d91a8404e26f124d16cc91ff08291bd700c1b.zip
gcc-2d8d91a8404e26f124d16cc91ff08291bd700c1b.tar.gz
gcc-2d8d91a8404e26f124d16cc91ff08291bd700c1b.tar.bz2
* tree-sra.c (bitfield_overlaps_p): Fix oversight.
From-SVN: r141556
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 3689b69..60330b1 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -2961,8 +2961,13 @@ bitfield_overlaps_p (tree blen, tree bpos, struct sra_elt *fld,
}
else if (TREE_CODE (fld->element) == INTEGER_CST)
{
+ tree domain_type = TYPE_DOMAIN (TREE_TYPE (fld->parent->element));
flen = fold_convert (bitsizetype, TYPE_SIZE (fld->type));
fpos = fold_convert (bitsizetype, fld->element);
+ if (domain_type && TYPE_MIN_VALUE (domain_type))
+ fpos = size_binop (MINUS_EXPR, fpos,
+ fold_convert (bitsizetype,
+ TYPE_MIN_VALUE (domain_type)));
fpos = size_binop (MULT_EXPR, flen, fpos);
}
else