From: Richard Guenther Date: Wed, 23 May 2012 15:53:59 +0000 (+0000) Subject: Index... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e8257960f082cebe7ae514a11e13d9ea4c47233f;p=gcc.git Index... 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, From-SVN: r187805 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 82d084dfc96..dfb46e40501 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2012-05-23 Richard Guenther + + PR tree-optimization/53438 + * tree-sra.c (analyze_access_subtree): Correct bitfield exclusion. + 2012-05-23 Georg-Johann Lay PR target/53448 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,