On Tue, Mar 31, 2015 at 01:35:56PM +0200, Kai Tietz wrote: > Hi, > > This patch avoids that we try to operate on function-decl's cfun equal > to NULL within lower_emutls_function_body.
If DECL_STRUCT_FUNCTION (node->decl) is already NULL (for which functions?), then what is the point doing push_cfun/pop_cfun in that case at all? Shouldn't you just early return if DECL_STRUCT_FUNCTION (node->decl) is NULL? > > ChangeLog > > 2015-03-31 Kai Tietz <kti...@redhat.com> > > PR target/65566 > * tree-emutls.c (lower_emutls_function_body): Don't try to > operate on node's decl function is NULL. > > Ok for apply? > > Regards, > Kai > > Index: tree-emutls.c > =================================================================== > --- tree-emutls.c (Revision 221789) > +++ tree-emutls.c (Arbeitskopie) > @@ -635,6 +635,12 @@ lower_emutls_function_body (struct cgraph_node *no > > push_cfun (DECL_STRUCT_FUNCTION (node->decl)); > > + if (!cfun) > + { > + pop_cfun (); > + return; > + } > + > d.cfun_node = node; > d.builtin_decl = builtin_decl_explicit (BUILT_IN_EMUTLS_GET_ADDRESS); > /* This is where we introduce the declaration to the IL and so we have to Jakub