Commit 0c2b2040 by Richard Biener Committed by Richard Biener

re PR middle-end/57103 (ICE: verify_gimple failed: location references block not…

re PR middle-end/57103 (ICE: verify_gimple failed: location references block not in block tree with -ftree-parallelize-loops=4)

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.

From-SVN: r198418
parent 3f12f6e9
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.
2013-04-29 Teresa Johnson <tejohnson@google.com> 2013-04-29 Teresa Johnson <tejohnson@google.com>
PR bootstrap/57077 PR bootstrap/57077
......
2013-04-29 Richard Biener <rguenther@suse.de>
PR middle-end/57103
* gcc.dg/autopar/pr57103.c: New testcase.
2013-04-29 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> 2013-04-29 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
* gcc.dg/c1x-align-3.c: Add test for negative power of 2. * gcc.dg/c1x-align-3.c: Add test for negative power of 2.
......
/* { dg-do compile } */
/* { dg-options "-O -ftree-parallelize-loops=4" } */
int d[1024];
static inline int foo (void)
{
int s = 0;
int i = 0;
for (; i < 1024; i++)
s += d[i];
return s;
}
void bar (void)
{
if (foo ())
__builtin_abort ();
}
...@@ -6153,10 +6153,19 @@ move_stmt_op (tree *tp, int *walk_subtrees, void *data) ...@@ -6153,10 +6153,19 @@ move_stmt_op (tree *tp, int *walk_subtrees, void *data)
if (EXPR_P (t)) 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 || (p->orig_block == NULL_TREE
&& TREE_BLOCK (t) == NULL_TREE)) && block != NULL_TREE))
TREE_SET_BLOCK (t, p->new_block); 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) 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, ...@@ -6241,18 +6250,10 @@ move_stmt_r (gimple_stmt_iterator *gsi_p, bool *handled_ops_p,
gimple stmt = gsi_stmt (*gsi_p); gimple stmt = gsi_stmt (*gsi_p);
tree block = gimple_block (stmt); tree block = gimple_block (stmt);
if (p->orig_block == NULL_TREE if (block == p->orig_block
|| block == p->orig_block || (p->orig_block == NULL_TREE
|| block == NULL_TREE) && block != NULL_TREE))
gimple_set_block (stmt, p->new_block); 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)) switch (gimple_code (stmt))
{ {
...@@ -6486,14 +6487,6 @@ move_block_to_fn (struct function *dest_cfun, basic_block bb, ...@@ -6486,14 +6487,6 @@ move_block_to_fn (struct function *dest_cfun, basic_block bb,
e->goto_locus = d->new_block ? e->goto_locus = d->new_block ?
COMBINE_LOCATION_DATA (line_table, e->goto_locus, d->new_block) : COMBINE_LOCATION_DATA (line_table, e->goto_locus, d->new_block) :
LOCATION_LOCUS (e->goto_locus); 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
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment