From fca4c1d59a05f6ac806bb9ac1954ca56407e45b8 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Thu, 18 Feb 2010 22:00:21 +0000 Subject: [PATCH] objc-act.c (finish_var_decl): Set the generated symbols as "used". * objc-act.c (finish_var_decl): Set the generated symbols as "used". Co-Authored-By: Mike Stump From-SVN: r156877 --- gcc/objc/ChangeLog | 5 +++++ gcc/objc/objc-act.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 7f43dc018afd..a1673cdef2e8 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,8 @@ +2010-02-18 Iain Sandoe + Mike Stump + + * objc-act.c (finish_var_decl): Set the generated symbols as "used". + 2009-12-17 Shujing Zhao * objc-act.c (objc_substitute_decl, build_ivar_reference, diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 2680fd85bb5e..fae535cf29df 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -1524,6 +1524,14 @@ finish_var_decl (tree var, tree initializer) mark_decl_referenced (var); /* Mark the decl to avoid "defined but not used" warning. */ TREE_USED (var) = 1; + /* We reserve the right for the runtime to use/modify these variables + in ways that are opaque to us. */ + DECL_PRESERVE_P (var) = 1; + /* ipa*.c/cgraphunit.c use lookup attribute rather than testing + DECL_PRESERVE_P. Once they switch to testing DECL_PRESERVE_P, + this can be removed. */ + DECL_ATTRIBUTES (var) = tree_cons (get_identifier ("used"), NULL, + DECL_ATTRIBUTES (var)) ; } /* Find the decl for the constant string class reference. This is only -- 2.43.5