From 02de9c16f0fc4884e06e708cb65ea4a515899e9a Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Mon, 8 Jun 2015 10:15:34 +0000 Subject: [PATCH] objc-runtime-shared-support.c (build_module_descriptor): Set TREE_USED on UOBJC_MODULES_decl. * objc-runtime-shared-support.c (build_module_descriptor): Set TREE_USED on UOBJC_MODULES_decl. From-SVN: r224213 --- gcc/objc/ChangeLog | 5 +++++ gcc/objc/objc-runtime-shared-support.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 03327a52703..46c3cfdb939 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,8 @@ +2015-06-08 Aldy Hernandez + + * objc-runtime-shared-support.c (build_module_descriptor): Set + TREE_USED on UOBJC_MODULES_decl. + 2015-06-05 Aldy Hernandez * objc-act.c (objc_write_global_declarations): Adjust comment. diff --git a/gcc/objc/objc-runtime-shared-support.c b/gcc/objc/objc-runtime-shared-support.c index d9b3c27af47..1bcb14a2981 100644 --- a/gcc/objc/objc-runtime-shared-support.c +++ b/gcc/objc/objc-runtime-shared-support.c @@ -519,6 +519,9 @@ build_module_descriptor (long vers, tree attr) is referenced by the runtime and, therefore, needed. */ DECL_PRESERVE_P (UOBJC_MODULES_decl) = 1; + /* Squash `defined but not used' warning. */ + TREE_USED (UOBJC_MODULES_decl) = 1; + /* Allow the runtime to mark meta-data such that it can be assigned to target specific sections by the back-end. */ if (attr) -- 2.30.2