Commit 5d35c171 by Richard Guenther Committed by Richard Biener

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
parent 11f7dd15
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.
2006-06-15 Andrew MacLeod <amacleod@redhat.com> 2006-06-15 Andrew MacLeod <amacleod@redhat.com>
PR middle-end/27793 PR middle-end/27793
......
...@@ -2309,7 +2309,7 @@ ipa-reference.o : ipa-reference.c $(CONFIG_H) $(SYSTEM_H) \ ...@@ -2309,7 +2309,7 @@ ipa-reference.o : ipa-reference.c $(CONFIG_H) $(SYSTEM_H) \
$(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h $(DIAGNOSTIC_H)
ipa-pure-const.o : ipa-pure-const.c $(CONFIG_H) $(SYSTEM_H) \ ipa-pure-const.o : ipa-pure-const.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \ coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
pointer-set.h $(GGC_H) $(IPA_UTILS_H) $(C_COMMON_H) \ pointer-set.h $(GGC_H) $(IPA_UTILS_H) $(C_COMMON_H) $(TARGET_H) \
$(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h $(DIAGNOSTIC_H)
ipa-type-escape.o : ipa-type-escape.c $(CONFIG_H) $(SYSTEM_H) \ ipa-type-escape.o : ipa-type-escape.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \ coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
......
...@@ -51,6 +51,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ...@@ -51,6 +51,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "timevar.h" #include "timevar.h"
#include "diagnostic.h" #include "diagnostic.h"
#include "langhooks.h" #include "langhooks.h"
#include "target.h"
static struct pointer_set_t *visited_nodes; static struct pointer_set_t *visited_nodes;
...@@ -499,9 +500,11 @@ analyze_function (struct cgraph_node *fn) ...@@ -499,9 +500,11 @@ analyze_function (struct cgraph_node *fn)
l->pure_const_state = IPA_CONST; l->pure_const_state = IPA_CONST;
l->state_set_in_source = false; l->state_set_in_source = false;
/* If this is a volatile function, do not touch this unless it has /* If this function does not return normally or does not bind local,
been marked as const or pure by the front end. */ do not touch this unless it has been marked as const or pure by the
if (TREE_THIS_VOLATILE (decl)) front end. */
if (TREE_THIS_VOLATILE (decl)
|| !targetm.binds_local_p (decl))
{ {
l->pure_const_state = IPA_NEITHER; l->pure_const_state = IPA_NEITHER;
return; return;
......
2006-06-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/27781
* gcc.dg/tree-ssa/pr27781.c: New testcase.
2006-06-15 Thomas Koenig <Thomas.Koenig@online.de> 2006-06-15 Thomas Koenig <Thomas.Koenig@online.de>
* gfortran.dg/allocate_zerosize_2.f90: New test case. * gfortran.dg/allocate_zerosize_2.f90: New test case.
/* { dg-do compile } */
/* { dg-require-weak "" } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
void __attribute__((weak)) func(void)
{
/* no code */
}
int main()
{
func();
return 0;
}
/* { dg-final { scan-tree-dump "func \\(\\);" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment