]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-sra.c (sra_explode_bitfield_assignment): Always call unsigned_type_for...
authorJakub Jelinek <jakub@redhat.com>
Fri, 5 Dec 2008 16:57:08 +0000 (17:57 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 5 Dec 2008 16:57:08 +0000 (17:57 +0100)
* tree-sra.c (sra_explode_bitfield_assignment): Always
call unsigned_type_for, if the precision is higher than
needed, call build_nonstandard_integer_type.

From-SVN: r142483

gcc/ChangeLog
gcc/tree-sra.c

index 0f47e6a9a63f62607e6d5f52ac643c1f5d011ad7..0b9eb7094e463c343f4025b9418a91ad48d036d8 100644 (file)
@@ -1,5 +1,9 @@
 2008-12-05  Jakub Jelinek  <jakub@redhat.com>
 
+       * tree-sra.c (sra_explode_bitfield_assignment): Always
+       call unsigned_type_for, if the precision is higher than
+       needed, call build_nonstandard_integer_type.
+
        PR debug/38367
        * function.c (assign_parm_find_stack_rtl): If promoted_mode
        is wider than DECL_MODE, adjust MEM_OFFSET (stack_parm) for
index 3225d103854865fb5eac6c488d8d0b08bfabdac9..8cada854094c7fd17d2113270855af8d13049b28 100644 (file)
@@ -3013,11 +3013,9 @@ sra_explode_bitfield_assignment (tree var, tree vpos, bool to_var,
 
          infld = fld->replacement;
 
-         type = TREE_TYPE (infld);
+         type = unsigned_type_for (TREE_TYPE (infld));
          if (TYPE_PRECISION (type) != TREE_INT_CST_LOW (flen))
-           type = lang_hooks.types.type_for_size (TREE_INT_CST_LOW (flen), 1);
-         else
-           type = unsigned_type_for (type);
+           type = build_nonstandard_integer_type (TREE_INT_CST_LOW (flen), 1);
 
          if (TREE_CODE (infld) == BIT_FIELD_REF)
            {