diff options
author | Richard Guenther <rguenther@suse.de> | 2006-06-15 17:23:41 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2006-06-15 17:23:41 +0000 |
commit | 5d35c1715c44c574a5d75bac53c97a1ecfbc949a (patch) | |
tree | bf71461032c06919367509fa737fb0306b9ff826 /gcc/ipa-pure-const.c | |
parent | 11f7dd15f1893b04b07965f7cc8a6bfa9459ac9b (diff) | |
download | gcc-5d35c1715c44c574a5d75bac53c97a1ecfbc949a.tar.gz |
re PR middle-end/27781 (weak-attribute over-optimisation)
2006-06-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/27781
* Makefile.in (ipa-pure-const.o): Add $(TARGET_H) dependency.
* ipa-pure-const.c (target.h): Include.
(analyze_function): Do not analyze functions that do not
bind locally.
* gcc.dg/tree-ssa/pr27781.c: New testcase.
From-SVN: r114681
Diffstat (limited to 'gcc/ipa-pure-const.c')
-rw-r--r-- | gcc/ipa-pure-const.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index 079af5e12e2..041cf2984b1 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -51,6 +51,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #include "timevar.h" #include "diagnostic.h" #include "langhooks.h" +#include "target.h" static struct pointer_set_t *visited_nodes; @@ -499,9 +500,11 @@ analyze_function (struct cgraph_node *fn) l->pure_const_state = IPA_CONST; l->state_set_in_source = false; - /* If this is a volatile function, do not touch this unless it has - been marked as const or pure by the front end. */ - if (TREE_THIS_VOLATILE (decl)) + /* If this function does not return normally or does not bind local, + do not touch this unless it has been marked as const or pure by the + front end. */ + if (TREE_THIS_VOLATILE (decl) + || !targetm.binds_local_p (decl)) { l->pure_const_state = IPA_NEITHER; return; |