aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2017-07-25 09:59:44 +0000
committerGeorg-Johann Lay <gjl@gcc.gnu.org>2017-07-25 09:59:44 +0000
commitd172f538fd607f6e603af086ddcb0c112d199d7d (patch)
tree40ac61f147ffa123b216eb9b3c851f2b267cee43 /gcc/tree-ssa-structalias.c
parentd49718d6ff41cdf8ed6b013b9e099f7ec3541053 (diff)
downloadgcc-d172f538fd607f6e603af086ddcb0c112d199d7d.zip
gcc-d172f538fd607f6e603af086ddcb0c112d199d7d.tar.gz
gcc-d172f538fd607f6e603af086ddcb0c112d199d7d.tar.bz2
re PR lto/81487 ([mingw32] ld.exe: error: asprintf failed)
gcc/ PR 81487 * hsa-brig.c (brig_init): Use xasprintf instead of asprintf. * gimple-pretty-print.c (dump_profile, dump_probability): Same. * tree-ssa-structalias.c (alias_get_name): Same. From-SVN: r250499
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index e563e9d..16746e3 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -2827,7 +2827,6 @@ alias_get_name (tree decl)
{
const char *res = NULL;
char *temp;
- int num_printed = 0;
if (!dump_file)
return "NULL";
@@ -2836,14 +2835,11 @@ alias_get_name (tree decl)
{
res = get_name (decl);
if (res)
- num_printed = asprintf (&temp, "%s_%u", res, SSA_NAME_VERSION (decl));
+ temp = xasprintf ("%s_%u", res, SSA_NAME_VERSION (decl));
else
- num_printed = asprintf (&temp, "_%u", SSA_NAME_VERSION (decl));
- if (num_printed > 0)
- {
- res = ggc_strdup (temp);
- free (temp);
- }
+ temp = xasprintf ("_%u", SSA_NAME_VERSION (decl));
+ res = ggc_strdup (temp);
+ free (temp);
}
else if (DECL_P (decl))
{
@@ -2854,12 +2850,9 @@ alias_get_name (tree decl)
res = get_name (decl);
if (!res)
{
- num_printed = asprintf (&temp, "D.%u", DECL_UID (decl));
- if (num_printed > 0)
- {
- res = ggc_strdup (temp);
- free (temp);
- }
+ temp = xasprintf ("D.%u", DECL_UID (decl));
+ res = ggc_strdup (temp);
+ free (temp);
}
}
}