From 73f2fb9f9b0f8166d3af601a49452e152a68f6c6 Mon Sep 17 00:00:00 2001 From: sayle Date: Thu, 22 Apr 2004 15:46:09 +0000 Subject: * resource.c (write_resource_constructor): Guard call to possibly NULL targetm.asm_out.constructor with targetm.have_ctors_dtors. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81012 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/resource.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gcc/java/resource.c') diff --git a/gcc/java/resource.c b/gcc/java/resource.c index 5d4b72a13ae..bc2860dfd1f 100644 --- a/gcc/java/resource.c +++ b/gcc/java/resource.c @@ -129,6 +129,9 @@ write_resource_constructor (void) to scan the object file to find its ctor/dtor routine. */ TREE_PUBLIC (init_decl) = ! targetm.have_ctors_dtors; + /* Suppress spurious warnings. */ + TREE_USED (init_decl) = 1; + pushlevel (0); make_decl_rtl (init_decl, NULL); init_function_start (init_decl); @@ -156,8 +159,9 @@ write_resource_constructor (void) flag_inline_functions = saved_flag; } current_function_decl = NULL_TREE; - (* targetm.asm_out.constructor) (XEXP (DECL_RTL (init_decl), 0), - DEFAULT_INIT_PRIORITY); + if (targetm.have_ctors_dtors) + targetm.asm_out.constructor (XEXP (DECL_RTL (init_decl), 0), + DEFAULT_INIT_PRIORITY); input_location = saved_loc; } -- cgit v1.2.1