aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/resource.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2004-04-22 15:46:09 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2004-04-22 15:46:09 +0000
commita95cd5a0d46e37922e5a0c5eb4cd4d22bc21da29 (patch)
tree079e6b175cebb3f77c5cc337cb86c43f7c946aad /gcc/java/resource.c
parentb10e5b3a5e750c7f6a7a0c4550d9b573252a56aa (diff)
downloadgcc-a95cd5a0d46e37922e5a0c5eb4cd4d22bc21da29.zip
gcc-a95cd5a0d46e37922e5a0c5eb4cd4d22bc21da29.tar.gz
gcc-a95cd5a0d46e37922e5a0c5eb4cd4d22bc21da29.tar.bz2
resource.c (write_resource_constructor): Guard call to possibly NULL targetm.asm_out.constructor with...
* resource.c (write_resource_constructor): Guard call to possibly NULL targetm.asm_out.constructor with targetm.have_ctors_dtors. From-SVN: r81012
Diffstat (limited to 'gcc/java/resource.c')
-rw-r--r--gcc/java/resource.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/java/resource.c b/gcc/java/resource.c
index 5d4b72a..bc2860d 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;
}