aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-gimplify.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2016-02-25 23:53:58 -0500
committerJason Merrill <jason@gcc.gnu.org>2016-02-25 23:53:58 -0500
commit8ba8c3757ba2d1325e75b637ca410609f716d4c0 (patch)
treeecbeacf79ae336045e5b24c0ee8a24afd2d7f6d2 /gcc/cp/cp-gimplify.c
parent1569de0fd6ea025af3e5cb70a0401eaf00d7946d (diff)
downloadgcc-8ba8c3757ba2d1325e75b637ca410609f716d4c0.zip
gcc-8ba8c3757ba2d1325e75b637ca410609f716d4c0.tar.gz
gcc-8ba8c3757ba2d1325e75b637ca410609f716d4c0.tar.bz2
re PR c++/69889 (ICE: in assign_temp, at function.c:961)
PR c++/69889 * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New. * tree.c (build_aggr_init_expr): Set it. * semantics.c (simplify_aggr_init_expr): Check it. * cp-gimplify.c (cp_genericize_r): Don't walk into a call/aggr_init from a thunk. From-SVN: r233733
Diffstat (limited to 'gcc/cp/cp-gimplify.c')
-rw-r--r--gcc/cp/cp-gimplify.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index a77b242..6af3760 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -1021,10 +1021,16 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
&& omp_var_to_track (stmt))
omp_cxx_notice_variable (wtd->omp_ctx, stmt);
- if (is_invisiref_parm (stmt)
- /* Don't dereference parms in a thunk, pass the references through. */
- && !(DECL_THUNK_P (current_function_decl)
- && TREE_CODE (stmt) == PARM_DECL))
+ /* Don't dereference parms in a thunk, pass the references through. */
+ if ((TREE_CODE (stmt) == CALL_EXPR && CALL_FROM_THUNK_P (stmt))
+ || (TREE_CODE (stmt) == AGGR_INIT_EXPR && AGGR_INIT_FROM_THUNK_P (stmt)))
+ {
+ *walk_subtrees = 0;
+ return NULL;
+ }
+
+ /* Otherwise, do dereference invisible reference parms. */
+ if (is_invisiref_parm (stmt))
{
*stmt_p = convert_from_reference (stmt);
*walk_subtrees = 0;