Commit 5b32ec10 by Richard Biener Committed by Richard Biener

re PR tree-optimization/86076 (ICE: verify_gimple failed (error: location…

re PR tree-optimization/86076 (ICE: verify_gimple failed (error: location references block not in block tree))

2018-06-15  Richard Biener  <rguenther@suse.de>

	PR middle-end/86076
	* tree-cfg.c (move_stmt_op): unshare invariant addresses
	before adjusting their block.

	* gcc.dg/pr86076.c: New testcase.

From-SVN: r261620
parent a8ef8061
2018-06-15 Richard Biener <rguenther@suse.de>
PR middle-end/86076
* tree-cfg.c (move_stmt_op): unshare invariant addresses
before adjusting their block.
2018-06-15 Sebastian Huber <sebastian.huber@embedded-brains.de>
* config.gcc (riscv*-*-elf* | riscv*-*-rtems*): Use custom
......
2018-06-15 Richard Biener <rguenther@suse.de>
PR middle-end/86076
* gcc.dg/pr86076.c: New testcase.
2018-06-14 Marek Polacek <polacek@redhat.com>
PR c++/86063
......
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fno-tree-dce -fno-tree-pre -fno-tree-vrp --param max-loop-header-insns=1" } */
int __attribute__ ((noinline))
lv (int tm)
{
(void) tm;
return 0;
}
void
o7 (int uu)
{
while (uu < 1)
while (uu != 0)
{
short int ca;
ca = lv (0);
(void) ca;
++uu;
}
lv (lv (0));
}
......@@ -6745,7 +6745,16 @@ move_stmt_op (tree *tp, int *walk_subtrees, void *data)
;
else if (block == p->orig_block
|| p->orig_block == NULL_TREE)
TREE_SET_BLOCK (t, p->new_block);
{
/* tree_node_can_be_shared says we can share invariant
addresses but unshare_expr copies them anyways. Make sure
to unshare before adjusting the block in place - we do not
always see a copy here. */
if (TREE_CODE (t) == ADDR_EXPR
&& is_gimple_min_invariant (t))
*tp = t = unshare_expr (t);
TREE_SET_BLOCK (t, p->new_block);
}
else if (flag_checking)
{
while (block && TREE_CODE (block) == BLOCK && block != p->orig_block)
......
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