summaryrefslogtreecommitdiff
path: root/gcc/c/c-aux-info.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-27 21:19:54 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-27 21:19:54 +0000
commit8c58361319db3a49ee075975624fbdd1a0bafcbc (patch)
treefc373dcf571c4d95f7e98e6a749abf747eeed40f /gcc/c/c-aux-info.c
parent8dc7da958de5c1302bf95c9442cc2fc81555ad4f (diff)
downloadgcc-8c58361319db3a49ee075975624fbdd1a0bafcbc.tar.gz
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' git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214608 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c/c-aux-info.c')
-rw-r--r--gcc/c/c-aux-info.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/c/c-aux-info.c b/gcc/c/c-aux-info.c
index 4b6b2d0f2bc..878807bb582 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);
}