+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>
PR middle-end/27793
$(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) \
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)
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 \
#include "timevar.h"
#include "diagnostic.h"
#include "langhooks.h"
+#include "target.h"
static struct pointer_set_t *visited_nodes;
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;
+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>
* gfortran.dg/allocate_zerosize_2.f90: New test case.
--- /dev/null
+/* { 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" } } */