summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-23 10:10:20 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-23 10:10:20 +0000
commit09cd13299ba3396177b2bab858c46231db9fe7e7 (patch)
tree43ca308d4920f942e7947d28b7a6ba253330379e
parent6a06c82438d4ebb3d39a6ad64287bfdc9bc528ae (diff)
downloadppe42-gcc-09cd13299ba3396177b2bab858c46231db9fe7e7.tar.gz
ppe42-gcc-09cd13299ba3396177b2bab858c46231db9fe7e7.zip
* cp/decl2.c (finish_objects): Do not call target constructor/destructor
bits dirrectly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124062 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl2.c24
2 files changed, 15 insertions, 14 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 326ed7025eb..1b19ffca397 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-23 Jan Hubicka <jh@suse.cz>
+
+ * cp/decl2.c (finish_objects): Do not call target constructor/destructor
+ bits dirrectly.
+
2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
* cp-tree.h (lang_tree_node): Use GENERIC_NEXT
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 54d5aa22939..41778283236 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -2363,23 +2363,19 @@ finish_objects (int method_type, int initp, tree body)
/* Finish up. */
finish_compound_stmt (body);
fn = finish_function (0);
- expand_or_defer_fn (fn);
-
- /* When only doing semantic analysis, and no RTL generation, we
- can't call functions that directly emit assembly code; there is
- no assembly file in which to put the code. */
- if (flag_syntax_only)
- return;
- if (targetm.have_ctors_dtors)
+ if (method_type == 'I')
{
- rtx fnsym = XEXP (DECL_RTL (fn), 0);
- cgraph_mark_needed_node (cgraph_node (fn));
- if (method_type == 'I')
- (* targetm.asm_out.constructor) (fnsym, initp);
- else
- (* targetm.asm_out.destructor) (fnsym, initp);
+ DECL_STATIC_CONSTRUCTOR (fn) = 1;
+ decl_init_priority_insert (fn, initp);
}
+ else
+ {
+ DECL_STATIC_DESTRUCTOR (fn) = 1;
+ decl_fini_priority_insert (fn, initp);
+ }
+
+ expand_or_defer_fn (fn);
}
/* The names of the parameters to the function created to handle
OpenPOWER on IntegriCloud