diff options
author | wschmidt <wschmidt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-23 15:53:59 +0000 |
---|---|---|
committer | wschmidt <wschmidt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-23 15:53:59 +0000 |
commit | 53b5b75f3d0a0c3bec5c8d1e106bed58f5c30f23 (patch) | |
tree | 71cf1899abd1b29b659202698f5a3b27015be6b7 /gcc/tree-sra.c | |
parent | 7ce72b6160084f848bd07ed44961fc496a5baa29 (diff) | |
download | gcc-53b5b75f3d0a0c3bec5c8d1e106bed58f5c30f23.tar.gz |
Index: gcc/tree-sra.c
===================================================================
--- gcc/tree-sra.c (revision 187800)
+++ gcc/tree-sra.c (working copy)
@@ -2096,9 +2096,12 @@ analyze_access_subtree (struct access *root, struc
&& (TREE_CODE (root->type) != INTEGER_TYPE
|| TYPE_PRECISION (root->type) != root->size)
/* But leave bitfield accesses alone. */
- && (root->offset % BITS_PER_UNIT) == 0)
+ && (TREE_CODE (root->expr) != COMPONENT_REF
+ || !DECL_BIT_FIELD (TREE_OPERAND (root->expr, 1))))
{
tree rt = root->type;
+ gcc_assert ((root->offset % BITS_PER_UNIT) == 0
+ && (root->size % BITS_PER_UNIT) == 0);
root->type = build_nonstandard_integer_type (root->size,
TYPE_UNSIGNED (rt));
root->expr = build_ref_for_offset (UNKNOWN_LOCATION,
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187805 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r-- | gcc/tree-sra.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 3f84f6b22fb..0438084f2ff 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -2096,9 +2096,12 @@ analyze_access_subtree (struct access *root, struct access *parent, && (TREE_CODE (root->type) != INTEGER_TYPE || TYPE_PRECISION (root->type) != root->size) /* But leave bitfield accesses alone. */ - && (root->offset % BITS_PER_UNIT) == 0) + && (TREE_CODE (root->expr) != COMPONENT_REF + || !DECL_BIT_FIELD (TREE_OPERAND (root->expr, 1)))) { tree rt = root->type; + gcc_assert ((root->offset % BITS_PER_UNIT) == 0 + && (root->size % BITS_PER_UNIT) == 0); root->type = build_nonstandard_integer_type (root->size, TYPE_UNSIGNED (rt)); root->expr = build_ref_for_offset (UNKNOWN_LOCATION, |