aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChen Gang <gang.chen.5i5j@gmail.com>2014-08-27 21:19:54 +0000
committerJeff Law <law@gcc.gnu.org>2014-08-27 15:19:54 -0600
commitb7679d96ec58fe7e67cbc535d1e3b055e40ac4f3 (patch)
treefc373dcf571c4d95f7e98e6a749abf747eeed40f /gcc
parent710427e290148e6f4739cb56b4ce5967addbfc38 (diff)
downloadgcc-b7679d96ec58fe7e67cbc535d1e3b055e40ac4f3.zip
gcc-b7679d96ec58fe7e67cbc535d1e3b055e40ac4f3.tar.gz
gcc-b7679d96ec58fe7e67cbc535d1e3b055e40ac4f3.tar.bz2
c-aux-info.c (gen_type): Resize 'buff' from 10 to 23 bytes...
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c/ChangeLog5
-rw-r--r--gcc/c/c-aux-info.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 00fb275..c4661ff 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -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
diff --git a/gcc/c/c-aux-info.c b/gcc/c/c-aux-info.c
index 4b6b2d0..878807b 100644
--- a/gcc/c/c-aux-info.c
+++ b/gcc/c/c-aux-info.c
@@ -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);
}