aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-05-23 15:53:59 +0000
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>2012-05-23 15:53:59 +0000
commit7e4c57765c6c133e67cf42ce194a06fb916303ed (patch)
tree71cf1899abd1b29b659202698f5a3b27015be6b7 /gcc/tree-sra.c
parent58e618d406882b11588524bac1c7c41b0c05b8c0 (diff)
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: https://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.c5
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,