From patchwork Thu Aug 26 14:19:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix PR45255 From: Richard Guenther X-Patchwork-Id: 62780 Message-Id: To: gcc-patches@gcc.gnu.org Date: Thu, 26 Aug 2010 16:19:18 +0200 (CEST) As noted by several people the DECL_DLLIMPORT_P test in decl_address_invariant_p does not make much sense. Bootstrapped and tested on x86_64-unknown-linux-gnu, the bug audit trail says also tested on Windows 7 x64 multi-lib native. Committed. Richard. 2010-08-26 Richard Guenther PR tree-optimization/45255 * tree.c (decl_address_invariant_p): DECL_DLLIMPORT_P statics and externals are also invariant. Index: gcc/tree.c =================================================================== --- gcc/tree.c (revision 163562) +++ gcc/tree.c (working copy) @@ -2474,8 +2474,7 @@ decl_address_invariant_p (const_tree op) return true; case VAR_DECL: - if (((TREE_STATIC (op) || DECL_EXTERNAL (op)) - && !DECL_DLLIMPORT_P (op)) + if ((TREE_STATIC (op) || DECL_EXTERNAL (op)) || DECL_THREAD_LOCAL_P (op) || DECL_CONTEXT (op) == current_function_decl || decl_function_context (op) == current_function_decl)