From 395a40e0e28129430ca707dad8475fefad3d8782 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sun, 22 Apr 2007 17:33:32 +0200 Subject: misc.c (gnat_expand_body): Don't call target for destructors, avoid redundant check on syntax errors. * ada/misc.c (gnat_expand_body): Don't call target for destructors, avoid redundant check on syntax errors. * final.c (rest_of_handle_final): Call targetm.asm_out.constructor/targetm.asm_out.destructor * cgraphunit.c (cgraph_build_static_cdtor): Don't do it here; set proper priority via decl_*_priority_insert. * c-common.c (c_expand_body): Likewise. From-SVN: r124044 --- gcc/cgraphunit.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'gcc/cgraphunit.c') diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 416cf3ecce9..13079a2b803 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1366,9 +1366,11 @@ cgraph_build_static_cdtor (char which, tree body, int priority) { case 'I': DECL_STATIC_CONSTRUCTOR (decl) = 1; + decl_init_priority_insert (decl, priority); break; case 'D': DECL_STATIC_DESTRUCTOR (decl) = 1; + decl_fini_priority_insert (decl, priority); break; default: gcc_unreachable (); @@ -1378,17 +1380,6 @@ cgraph_build_static_cdtor (char which, tree body, int priority) cgraph_add_new_function (decl, false); cgraph_mark_needed_node (cgraph_node (decl)); - - if (targetm.have_ctors_dtors) - { - void (*fn) (rtx, int); - - if (which == 'I') - fn = targetm.asm_out.constructor; - else - fn = targetm.asm_out.destructor; - fn (XEXP (DECL_RTL (decl), 0), priority); - } } void -- cgit v1.2.1