* tree-flow.h (add_referenced_var): Return bool instead of void.
* tree-dfa.c (add_referenced_var): Return result of
referenced_var_check_and_insert call.
* tree-inline.c (expand_call_inline): Call add_referenced_var instead
of referenced_var_check_and_insert.
* gcc.c-torture/compile/pr39360.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144683
138bc75d-0d04-0410-961f-
82ee72b054a4
2009-03-06 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/39360
+ * tree-flow.h (add_referenced_var): Return bool instead of void.
+ * tree-dfa.c (add_referenced_var): Return result of
+ referenced_var_check_and_insert call.
+ * tree-inline.c (expand_call_inline): Call add_referenced_var instead
+ of referenced_var_check_and_insert.
+
PR debug/39372
* dwarf2out.c (add_abstract_origin_attribute): Return
origin_die.
2009-03-06 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/39360
+ * gcc.c-torture/compile/pr39360.c: New test.
+
PR debug/39372
* g++.dg/debug/dwarf2/static-local-var-in-ctor.C: New test.
--- /dev/null
+/* PR middle-end/39360 */
+
+static int a[] = { 1 };
+
+static inline void
+bar (int **x)
+{
+ static int *c[2] = { 0, a };
+ *x = c[1];
+}
+
+int
+foo (int **x)
+{
+ bar (x);
+}
/* Data flow functions for trees.
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software
- Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
+ Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@redhat.com>
This file is part of GCC.
/* Add VAR to the list of referenced variables if it isn't already there. */
-void
+bool
add_referenced_var (tree var)
{
var_ann_t v_ann;
/* Tag's don't have DECL_INITIAL. */
if (MTAG_P (var))
- return;
+ return true;
/* Scan DECL_INITIAL for pointer variables as they may contain
address arithmetic referencing the address of other
optimizers. */
&& !DECL_EXTERNAL (var))
walk_tree (&DECL_INITIAL (var), find_vars_r, NULL, 0);
+
+ return true;
}
+
+ return false;
}
/* Remove VAR from the list. */
extern void dump_variable (FILE *, tree);
extern void debug_variable (tree);
extern tree get_virtual_var (tree);
-extern void add_referenced_var (tree);
+extern bool add_referenced_var (tree);
extern void remove_referenced_var (tree);
extern void mark_symbols_for_renaming (gimple);
extern void find_new_referenced_vars (gimple);
/* Tree inlining.
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Alexandre Oliva <aoliva@redhat.com>
var = TREE_VALUE (t_step);
if (TREE_STATIC (var) && !TREE_ASM_WRITTEN (var))
{
- if (var_ann (var) && referenced_var_check_and_insert (var))
+ if (var_ann (var) && add_referenced_var (var))
cfun->local_decls = tree_cons (NULL_TREE, var,
cfun->local_decls);
}