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
* call.c (build_op_call_1): Use convert_like_with_context only
if cand->fn is a decl.
{
tree d = DECL_EXPR_DECL (stmt);
if (TREE_CODE (d) == VAR_DECL)
- {
- 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);
- }
+ gcc_assert (CP_DECL_THREAD_LOCAL_P (d) == DECL_THREAD_LOCAL_P (d));
}
else if (TREE_CODE (stmt) == OMP_PARALLEL
|| TREE_CODE (stmt) == OMP_TASK
*walk_subtrees_p = 0;
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:
return NULL_TREE;
}