This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Trust TREE_ADDRESSABLE
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jan Hubicka <hubicka at ucw dot cz>
- Date: Wed, 4 Jun 2014 15:48:12 +0200 (CEST)
- Subject: [PATCH] Trust TREE_ADDRESSABLE
- Authentication-results: sourceware.org; auth=none
This makes may_be_aliased trust TREE_ADDRESSABLE setting for
exported decls. This should make it possible for LTO to
compute more optimistic aliasing and removes the pessimization
with respective to aliasing that currently LTO brought global
(but hidden visibility) statics cause.
Bootstrapped and tested on x86_64-unknown-linux-gnu for all
languages including obj-c++, ada and go (yay), applied.
Richard.
2014-06-04 Richard Biener <rguenther@suse.de>
* tree.h (may_be_aliased): Trust TREE_ADDRESSABLE from
TREE_PUBLIC and DECL_EXTERNAL decls.
Index: gcc/tree.h
===================================================================
--- gcc/tree.h (revision 211215)
+++ gcc/tree.h (working copy)
@@ -4506,9 +4506,7 @@ static inline bool
may_be_aliased (const_tree var)
{
return (TREE_CODE (var) != CONST_DECL
- && (TREE_PUBLIC (var)
- || DECL_EXTERNAL (var)
- || TREE_ADDRESSABLE (var))
+ && TREE_ADDRESSABLE (var)
&& !((TREE_STATIC (var) || TREE_PUBLIC (var) || DECL_EXTERNAL (var))
&& ((TREE_READONLY (var)
&& !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (var)))