diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-29 14:12:54 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-29 14:12:54 +0000 |
commit | 00ef57e3da7f3c49bccafd270a96ebd8a5823b8c (patch) | |
tree | 86c9f1c852b4ea96236a5e6c7f1d18cad40679b9 /gcc/tree-cfg.c | |
parent | 1a0876242db3bd2c349405b4a9f9cc47f36bc7d1 (diff) | |
download | gcc-00ef57e3da7f3c49bccafd270a96ebd8a5823b8c.tar.gz |
2013-04-29 Richard Biener <rguenther@suse.de>
PR middle-end/57103
* tree-cfg.c (move_stmt_op): Fix condition under which to update
TREE_BLOCK.
(move_stmt_r): Remove redundant checking.
* gcc.dg/autopar/pr57103.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198418 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index a8e9f5cbab6..9b00248ece6 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -6153,10 +6153,19 @@ move_stmt_op (tree *tp, int *walk_subtrees, void *data) if (EXPR_P (t)) { - if (TREE_BLOCK (t) == p->orig_block + tree block = TREE_BLOCK (t); + if (block == p->orig_block || (p->orig_block == NULL_TREE - && TREE_BLOCK (t) == NULL_TREE)) + && block != NULL_TREE)) TREE_SET_BLOCK (t, p->new_block); +#ifdef ENABLE_CHECKING + else if (block != NULL_TREE) + { + while (block && TREE_CODE (block) == BLOCK && block != p->orig_block) + block = BLOCK_SUPERCONTEXT (block); + gcc_assert (block == p->orig_block); + } +#endif } else if (DECL_P (t) || TREE_CODE (t) == SSA_NAME) { @@ -6241,18 +6250,10 @@ move_stmt_r (gimple_stmt_iterator *gsi_p, bool *handled_ops_p, gimple stmt = gsi_stmt (*gsi_p); tree block = gimple_block (stmt); - if (p->orig_block == NULL_TREE - || block == p->orig_block - || block == NULL_TREE) + if (block == p->orig_block + || (p->orig_block == NULL_TREE + && block != NULL_TREE)) gimple_set_block (stmt, p->new_block); -#ifdef ENABLE_CHECKING - else if (block != p->new_block) - { - while (block && block != p->orig_block) - block = BLOCK_SUPERCONTEXT (block); - gcc_assert (block); - } -#endif switch (gimple_code (stmt)) { @@ -6486,14 +6487,6 @@ move_block_to_fn (struct function *dest_cfun, basic_block bb, e->goto_locus = d->new_block ? COMBINE_LOCATION_DATA (line_table, e->goto_locus, d->new_block) : LOCATION_LOCUS (e->goto_locus); -#ifdef ENABLE_CHECKING - else if (block != d->new_block) - { - while (block && block != d->orig_block) - block = BLOCK_SUPERCONTEXT (block); - gcc_assert (block); - } -#endif } } |