re PR middle-end/39360 (ICE in referenced_var_lookup, at tree-dfa.c:563)
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. * gcc.c-torture/compile/pr39360.c: New test. From-SVN: r144683
This commit is contained in:
parent
9f0e7885bb
commit
65401a0ba3
@ -1,5 +1,12 @@
|
|||||||
2009-03-06 Jakub Jelinek <jakub@redhat.com>
|
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
|
PR debug/39372
|
||||||
* dwarf2out.c (add_abstract_origin_attribute): Return
|
* dwarf2out.c (add_abstract_origin_attribute): Return
|
||||||
origin_die.
|
origin_die.
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
2009-03-06 Jakub Jelinek <jakub@redhat.com>
|
2009-03-06 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR middle-end/39360
|
||||||
|
* gcc.c-torture/compile/pr39360.c: New test.
|
||||||
|
|
||||||
PR debug/39372
|
PR debug/39372
|
||||||
* g++.dg/debug/dwarf2/static-local-var-in-ctor.C: New test.
|
* g++.dg/debug/dwarf2/static-local-var-in-ctor.C: New test.
|
||||||
|
|
||||||
|
16
gcc/testsuite/gcc.c-torture/compile/pr39360.c
Normal file
16
gcc/testsuite/gcc.c-torture/compile/pr39360.c
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/* 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);
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
/* Data flow functions for trees.
|
/* Data flow functions for trees.
|
||||||
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software
|
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
|
||||||
Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
Contributed by Diego Novillo <dnovillo@redhat.com>
|
Contributed by Diego Novillo <dnovillo@redhat.com>
|
||||||
|
|
||||||
This file is part of GCC.
|
This file is part of GCC.
|
||||||
@ -639,7 +639,7 @@ set_default_def (tree var, tree def)
|
|||||||
|
|
||||||
/* Add VAR to the list of referenced variables if it isn't already there. */
|
/* Add VAR to the list of referenced variables if it isn't already there. */
|
||||||
|
|
||||||
void
|
bool
|
||||||
add_referenced_var (tree var)
|
add_referenced_var (tree var)
|
||||||
{
|
{
|
||||||
var_ann_t v_ann;
|
var_ann_t v_ann;
|
||||||
@ -655,7 +655,7 @@ add_referenced_var (tree var)
|
|||||||
|
|
||||||
/* Tag's don't have DECL_INITIAL. */
|
/* Tag's don't have DECL_INITIAL. */
|
||||||
if (MTAG_P (var))
|
if (MTAG_P (var))
|
||||||
return;
|
return true;
|
||||||
|
|
||||||
/* Scan DECL_INITIAL for pointer variables as they may contain
|
/* Scan DECL_INITIAL for pointer variables as they may contain
|
||||||
address arithmetic referencing the address of other
|
address arithmetic referencing the address of other
|
||||||
@ -667,7 +667,11 @@ add_referenced_var (tree var)
|
|||||||
optimizers. */
|
optimizers. */
|
||||||
&& !DECL_EXTERNAL (var))
|
&& !DECL_EXTERNAL (var))
|
||||||
walk_tree (&DECL_INITIAL (var), find_vars_r, NULL, 0);
|
walk_tree (&DECL_INITIAL (var), find_vars_r, NULL, 0);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove VAR from the list. */
|
/* Remove VAR from the list. */
|
||||||
|
@ -768,7 +768,7 @@ extern void dump_referenced_vars (FILE *);
|
|||||||
extern void dump_variable (FILE *, tree);
|
extern void dump_variable (FILE *, tree);
|
||||||
extern void debug_variable (tree);
|
extern void debug_variable (tree);
|
||||||
extern tree get_virtual_var (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 remove_referenced_var (tree);
|
||||||
extern void mark_symbols_for_renaming (gimple);
|
extern void mark_symbols_for_renaming (gimple);
|
||||||
extern void find_new_referenced_vars (gimple);
|
extern void find_new_referenced_vars (gimple);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Tree inlining.
|
/* 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.
|
Free Software Foundation, Inc.
|
||||||
Contributed by Alexandre Oliva <aoliva@redhat.com>
|
Contributed by Alexandre Oliva <aoliva@redhat.com>
|
||||||
|
|
||||||
@ -3383,7 +3383,7 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
|
|||||||
var = TREE_VALUE (t_step);
|
var = TREE_VALUE (t_step);
|
||||||
if (TREE_STATIC (var) && !TREE_ASM_WRITTEN (var))
|
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 = tree_cons (NULL_TREE, var,
|
||||||
cfun->local_decls);
|
cfun->local_decls);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user