[Bug tree-optimization/86076] [7/8/9 Regression] ICE: verify_gimple failed (error: location references block not in block tree)
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jun 14 13:03:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86076
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
I have a patch.
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 5f6defa6fe7..e7d16ca0a14 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -6742,7 +6742,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)
More information about the Gcc-bugs
mailing list