http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52244

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-14 
13:25:10 UTC ---
Index: gcc/tree-sra.c
===================================================================
--- gcc/tree-sra.c      (revision 184203)
+++ gcc/tree-sra.c      (working copy)
@@ -2172,11 +2172,16 @@ analyze_access_subtree (struct access *r
              && (root->grp_scalar_write || root->grp_assignment_write))))
     {
       bool new_integer_type;
-      if (TREE_CODE (root->type) == ENUMERAL_TYPE)
+      if (INTEGRAL_TYPE_P (root->type)
+         && (TREE_CODE (root->type) != INTEGER_TYPE
+             || TYPE_PRECISION (root->type) != root->size))
        {
          tree rt = root->type;
-         root->type = build_nonstandard_integer_type (TYPE_PRECISION (rt),
+         root->type = build_nonstandard_integer_type (root->size,
                                                       TYPE_UNSIGNED (rt));
+         root->expr = build_ref_for_offset (UNKNOWN_LOCATION,
+                                            root->base, root->offset,
+                                            root->type, NULL, false);
          new_integer_type = true;
        }
       else

that is.

Reply via email to