Commit e43ebb12 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/70869 (internal compiler error: Segmentation fault on array of pointer…

re PR c++/70869 (internal compiler error: Segmentation fault on array of pointer to function members)

	PR c++/70869
	PR c++/71054
	* cp-gimplify.c (cp_genericize_r): Revert the 2016-07-07 change.
	* tree.c (cp_walk_subtrees): For DECL_EXPR on DECL_ARTIFICIAL
	non-static VAR_DECL, walk the decl's DECL_INITIAL, DECL_SIZE and
	DECL_SIZE_UNIT.

From-SVN: r238444
parent 99516432
2016-07-18 Jakub Jelinek <jakub@redhat.com> 2016-07-18 Jakub Jelinek <jakub@redhat.com>
PR c++/70869
PR c++/71054
* cp-gimplify.c (cp_genericize_r): Revert the 2016-07-07 change.
* tree.c (cp_walk_subtrees): For DECL_EXPR on DECL_ARTIFICIAL
non-static VAR_DECL, walk the decl's DECL_INITIAL, DECL_SIZE and
DECL_SIZE_UNIT.
PR c++/71835 PR c++/71835
* call.c (build_op_call_1): Use convert_like_with_context only * call.c (build_op_call_1): Use convert_like_with_context only
if cand->fn is a decl. if cand->fn is a decl.
......
...@@ -1351,15 +1351,7 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data) ...@@ -1351,15 +1351,7 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
{ {
tree d = DECL_EXPR_DECL (stmt); tree d = DECL_EXPR_DECL (stmt);
if (TREE_CODE (d) == VAR_DECL) if (TREE_CODE (d) == VAR_DECL)
{ gcc_assert (CP_DECL_THREAD_LOCAL_P (d) == DECL_THREAD_LOCAL_P (d));
gcc_assert (CP_DECL_THREAD_LOCAL_P (d) == DECL_THREAD_LOCAL_P (d));
/* User var initializers should be genericized during containing
BIND_EXPR genericization when walk_tree walks DECL_INITIAL
of BIND_EXPR_VARS. Artificial temporaries might not be
mentioned there though, so walk them now. */
if (DECL_ARTIFICIAL (d) && !TREE_STATIC (d) && DECL_INITIAL (d))
cp_walk_tree (&DECL_INITIAL (d), cp_genericize_r, data, NULL);
}
} }
else if (TREE_CODE (stmt) == OMP_PARALLEL else if (TREE_CODE (stmt) == OMP_PARALLEL
|| TREE_CODE (stmt) == OMP_TASK || TREE_CODE (stmt) == OMP_TASK
......
...@@ -4075,6 +4075,22 @@ cp_walk_subtrees (tree *tp, int *walk_subtrees_p, walk_tree_fn func, ...@@ -4075,6 +4075,22 @@ cp_walk_subtrees (tree *tp, int *walk_subtrees_p, walk_tree_fn func,
*walk_subtrees_p = 0; *walk_subtrees_p = 0;
break; break;
case DECL_EXPR:
/* User variables should be mentioned in BIND_EXPR_VARS
and their initializers and sizes walked when walking
the containing BIND_EXPR. Compiler temporaries are
handled here. */
if (VAR_P (TREE_OPERAND (*tp, 0))
&& DECL_ARTIFICIAL (TREE_OPERAND (*tp, 0))
&& !TREE_STATIC (TREE_OPERAND (*tp, 0)))
{
tree decl = TREE_OPERAND (*tp, 0);
WALK_SUBTREE (DECL_INITIAL (decl));
WALK_SUBTREE (DECL_SIZE (decl));
WALK_SUBTREE (DECL_SIZE_UNIT (decl));
}
break;
default: default:
return NULL_TREE; return NULL_TREE;
} }
......
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