diff options
author | Richard Guenther <rguenther@suse.de> | 2012-07-04 12:09:09 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-07-04 12:09:09 +0000 |
commit | e1b6bbea37bb9e0dfaba80f5d7483fcd7ac9baa6 (patch) | |
tree | 5e6fc20de11fd47538decbdefaddec376dd6d655 | |
parent | 463d5aa029d128de82fac1bfd85bd10376673808 (diff) | |
download | gcc-e1b6bbea37bb9e0dfaba80f5d7483fcd7ac9baa6.zip gcc-e1b6bbea37bb9e0dfaba80f5d7483fcd7ac9baa6.tar.gz gcc-e1b6bbea37bb9e0dfaba80f5d7483fcd7ac9baa6.tar.bz2 |
re PR middle-end/53849 (ICE: in add_referenced_var_1, at tree-dfa.c:567 with -O2 -ftree-parallelize-loops=2 -fno-tree-loop-im)
2012-07-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/53849
* tree-cfg.c (move_stmt_op): Only call add_referenced_var
for duplicated locals. Use add_referenced_var_1 to avoid
pushing/popping cfun.
* gcc.dg/pr53849.c: New testcase.
From-SVN: r189255
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr53849.c | 13 | ||||
-rw-r--r-- | gcc/tree-cfg.c | 11 |
4 files changed, 29 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b5110a6..27c8cfc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-07-04 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/53849 + * tree-cfg.c (move_stmt_op): Only call add_referenced_var + for duplicated locals. Use add_referenced_var_1 to avoid + pushing/popping cfun. + 2012-07-04 Kai Tietz <ktietz@redhat.com> * config/i386/winnt.c (i386_pe_reloc_rw_mask): New function. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 42366fa..884f66b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-07-04 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/53849 + * gcc.dg/pr53849.c: New testcase. + 2012-07-03 Jakub Jelinek <jakub@redhat.com> PR c++/53812 diff --git a/gcc/testsuite/gcc.dg/pr53849.c b/gcc/testsuite/gcc.dg/pr53849.c new file mode 100644 index 0000000..3b67010 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr53849.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-parallelize-loops=2 -fno-tree-loop-im" } */ + +extern int *b, *e[8], d; + +void +foo (void) +{ + int i; + for (i = 0; i < 8; ++i) + while (--d) + e[i] = 0; +} diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index fe5af70..dd47609 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -6023,14 +6023,11 @@ move_stmt_op (tree *tp, int *walk_subtrees, void *data) if ((TREE_CODE (t) == VAR_DECL && !is_global_var (t)) || TREE_CODE (t) == CONST_DECL) - replace_by_duplicate_decl (tp, p->vars_map, p->to_context); - - if (SSA_VAR_P (t) - && gimple_in_ssa_p (cfun)) { - push_cfun (DECL_STRUCT_FUNCTION (p->to_context)); - add_referenced_var (*tp); - pop_cfun (); + struct function *to_fn = DECL_STRUCT_FUNCTION (p->to_context); + replace_by_duplicate_decl (tp, p->vars_map, p->to_context); + if (gimple_referenced_vars (to_fn)) + add_referenced_var_1 (*tp, to_fn); } } *walk_subtrees = 0; |