This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, PR 48601] cgraph_get_create_node in emultls.c
- From: Martin Jambor <mjambor at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 15 Apr 2011 19:25:52 +0200
- Subject: [PATCH, PR 48601] cgraph_get_create_node in emultls.c
Hi,
lower_emutls_function_body in emultls.c should use
cgraph_get_create_node to create call graph nodes if need be because
it is introducing TLS builtin decls into IL.
I have bootstrapped and tested this on x86_64-linux (where the bug
does not happen) and in bugzilla it has been confirmed it fixes the
issue. It is rather straight-forward and was pre-approved on IRC by
Honza so I am about to commit it now. Testcases are already in the
testsuite.
Thanks,
Martin
2011-04-15 Martin Jambor <mjambor@suse.cz>
PR middle-end/48601
* tree-emutls.c (lower_emutls_function_body): Call
cgraph_get_create_node instead of cgraph_get_node. Do not assert the
result is non-NULL.
Index: src/gcc/tree-emutls.c
===================================================================
--- src.orig/gcc/tree-emutls.c
+++ src/gcc/tree-emutls.c
@@ -619,8 +619,9 @@ lower_emutls_function_body (struct cgrap
d.cfun_node = node;
d.builtin_decl = built_in_decls[BUILT_IN_EMUTLS_GET_ADDRESS];
- d.builtin_node = cgraph_get_node (d.builtin_decl);
- gcc_checking_assert (d.builtin_node);
+ /* This is where we introduce the declaration to the IL and so we have to
+ create a node for it. */
+ d.builtin_node = cgraph_get_create_node (d.builtin_decl);
FOR_EACH_BB (d.bb)
{