From 7ecd7544b7f4ca1b36ab6621c62849d79c96e57c Mon Sep 17 00:00:00 2001 From: gjl Date: Tue, 25 Jul 2017 09:59:44 +0000 Subject: 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250499 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-ssa-structalias.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'gcc/tree-ssa-structalias.c') diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index e563e9dee72..16746e3da92 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); } } } -- cgit v1.2.1 From 280ce47d0f9dac29584586ae964826fffa4ab22f Mon Sep 17 00:00:00 2001 From: jakub Date: Thu, 27 Jul 2017 07:53:33 +0000 Subject: * attribs.c (decl_attributes): Imply noinline, noclone and no_icf attributes for noipa attribute. For naked attribute use lookup_attribute first before lookup_attribute_spec. * final.c (rest_of_handle_final): Disable IPA RA for functions with noipa attribute. * ipa-visibility.c (non_local_p): Fix comment typos. Return true for functions with noipa attribute. (cgraph_externally_visible_p): Return true for functions with noipa attribute. * cgraph.c (cgraph_node::get_availability): Return AVAIL_INTERPOSABLE for functions with noipa attribute. * doc/extend.texi: Document noipa function attribute. * tree-ssa-structalias.c (refered_from_nonlocal_fn): Set *nonlocal_p also for functions with noipa attribute. (ipa_pta_execute): Set nonlocal_p also for nodes with noipa attribute. c-family/ * c-attribs.c (c_common_attribute_table): Add noipa attribute. (handle_noipa_attribute): New function. testsuite/ * gcc.dg/attr-noipa.c: New test. * gcc.dg/ipa/ipa-pta-18.c: New test. * gcc.dg/ipa/ipa-sra-11.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250607 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-ssa-structalias.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc/tree-ssa-structalias.c') diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 16746e3da92..e743e35033e 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -7764,7 +7764,8 @@ refered_from_nonlocal_fn (struct cgraph_node *node, void *data) bool *nonlocal_p = (bool *)data; *nonlocal_p |= (node->used_from_other_partition || node->externally_visible - || node->force_output); + || node->force_output + || lookup_attribute ("noipa", DECL_ATTRIBUTES (node->decl))); return false; } @@ -7824,7 +7825,9 @@ ipa_pta_execute (void) constraints for parameters. */ bool nonlocal_p = (node->used_from_other_partition || node->externally_visible - || node->force_output); + || node->force_output + || lookup_attribute ("noipa", + DECL_ATTRIBUTES (node->decl))); node->call_for_symbol_thunks_and_aliases (refered_from_nonlocal_fn, &nonlocal_p, true); -- cgit v1.2.1