c-aux-info.c (gen_type): Resize 'buff' from 10 to 23 bytes...
authorChen Gang <gang.chen.5i5j@gmail.com>
Wed, 27 Aug 2014 21:19:54 +0000 (21:19 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 27 Aug 2014 21:19:54 +0000 (15:19 -0600)
2014-08-27  Chen Gang  <gang.chen.5i5j@gmail.com>

* c-aux-info.c (gen_type): Resize 'buff' from 10 to 23 bytes,
with using HOST_WIDE_INT without truncation to 'int'

From-SVN: r214608

gcc/c/ChangeLog
gcc/c/c-aux-info.c

index 00fb275613e61a21acd68abb9fa89afa47c4f366..c4661ff0dc894449b46830b744a4bbbf597f6980 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-27  Chen Gang  <gang.chen.5i5j@gmail.com>
+
+       * c-aux-info.c (gen_type): Resize 'buff' from 10 to 23 bytes,
+       with using HOST_WIDE_INT without truncation to 'int'
+
 2014-08-22  Marek Polacek  <polacek@redhat.com>
 
        PR c++/62199
index 4b6b2d0f2bcaa7a250daaee4caa9835ec4a2ba55..878807bb58281acbee5c5ded906d568762b30aa0 100644 (file)
@@ -310,9 +310,10 @@ gen_type (const char *ret_val, tree t, formals_style style)
                                TREE_TYPE (t), style);
          else
            {
-             int size = (int_size_in_bytes (t) / int_size_in_bytes (TREE_TYPE (t)));
-             char buff[10];
-             sprintf (buff, "[%d]", size);
+             char buff[23];
+             sprintf (buff, "["HOST_WIDE_INT_PRINT_DEC"]",
+                      int_size_in_bytes (t)
+                      / int_size_in_bytes (TREE_TYPE (t)));
              ret_val = gen_type (concat (ret_val, buff, NULL),
                                  TREE_TYPE (t), style);
            }