aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-09-19 16:36:38 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-09-19 16:36:38 +0200
commitfc15d9ecb432173f2a17c58352d4b70c1ee049e4 (patch)
tree4965aa4d1c429a1406e32def5da33e5b1008c386 /gcc/cgraph.c
parent3c9f5092c6d30a459e06b7db3f0796a1175e2ecc (diff)
downloadgcc-fc15d9ecb432173f2a17c58352d4b70c1ee049e4.zip
gcc-fc15d9ecb432173f2a17c58352d4b70c1ee049e4.tar.gz
gcc-fc15d9ecb432173f2a17c58352d4b70c1ee049e4.tar.bz2
re PR ipa/77587 (C compiler produces incorrect stack alignment with __attribute__((weak)))
PR target/77587 * cgraph.c (cgraph_node::rtl_info): Pass &avail to ultimate_alias_target call, return NULL if avail < AVAIL_AVAILABLE. Call ultimate_alias_target just once, not up to 4 times. * gcc.dg/pr77587.c: New test. * gcc.dg/pr77587a.c: New file. Co-Authored-By: Jan Hubicka <jh@suse.cz> From-SVN: r240232
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 9bc5b6b..0f9df95 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -1955,14 +1955,17 @@ cgraph_node::rtl_info (tree decl)
cgraph_node *node = get (decl);
if (!node)
return NULL;
- node = node->ultimate_alias_target ();
- if (node->decl != current_function_decl
- && !TREE_ASM_WRITTEN (node->decl))
+ enum availability avail;
+ node = node->ultimate_alias_target (&avail);
+ if (decl != current_function_decl
+ && (avail < AVAIL_AVAILABLE
+ || (node->decl != current_function_decl
+ && !TREE_ASM_WRITTEN (node->decl))))
return NULL;
- /* Allocate if it doesnt exist. */
- if (node->ultimate_alias_target ()->rtl == NULL)
- node->ultimate_alias_target ()->rtl = ggc_cleared_alloc<cgraph_rtl_info> ();
- return node->ultimate_alias_target ()->rtl;
+ /* Allocate if it doesn't exist. */
+ if (node->rtl == NULL)
+ node->rtl = ggc_cleared_alloc<cgraph_rtl_info> ();
+ return node->rtl;
}
/* Return a string describing the failure REASON. */