aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-04-11 15:50:57 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-04-11 15:50:57 +0000
commit956011be1f9a5369c4390bcccb5bb6198887e455 (patch)
tree74c24d546e7e1f8da54b8ac8e895851103d4fa2e /gcc
parent155e5d5f559fc3639da157b4c3a7ee41f62f43cb (diff)
downloadgcc-956011be1f9a5369c4390bcccb5bb6198887e455.zip
gcc-956011be1f9a5369c4390bcccb5bb6198887e455.tar.gz
gcc-956011be1f9a5369c4390bcccb5bb6198887e455.tar.bz2
gimplify.c (gimple_fold_indirect_ref): Check host_integerp before calling tree_low_cst.
2011-04-11 Richard Guenther <rguenther@suse.de> * gimplify.c (gimple_fold_indirect_ref): Check host_integerp before calling tree_low_cst. From-SVN: r172263
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/gimplify.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5363fe3..ce35db2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2011-04-11 Richard Guenther <rguenther@suse.de>
+ * gimplify.c (gimple_fold_indirect_ref): Check host_integerp
+ before calling tree_low_cst.
+
+2011-04-11 Richard Guenther <rguenther@suse.de>
+
* stor-layout.c (layout_type): Compute all array index size operations
in the original type.
(initialize_sizetypes): Add comment.
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 598fe9c..9afd4ff 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4079,9 +4079,10 @@ gimple_fold_indirect_ref (tree t)
/* ((foo*)&vectorfoo)[1] -> BIT_FIELD_REF<vectorfoo,...> */
if (TREE_CODE (addr) == ADDR_EXPR
&& TREE_CODE (TREE_TYPE (addrtype)) == VECTOR_TYPE
- && useless_type_conversion_p (type, TREE_TYPE (TREE_TYPE (addrtype))))
+ && useless_type_conversion_p (type, TREE_TYPE (TREE_TYPE (addrtype)))
+ && host_integerp (off, 1))
{
- HOST_WIDE_INT offset = tree_low_cst (off, 0);
+ unsigned HOST_WIDE_INT offset = tree_low_cst (off, 1);
tree part_width = TYPE_SIZE (type);
unsigned HOST_WIDE_INT part_widthi
= tree_low_cst (part_width, 0) / BITS_PER_UNIT;