diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-01-08 11:14:29 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-01-08 11:14:29 +0100 |
commit | 33f0852f542c5aa80a0f16cc71a69870a7a754ca (patch) | |
tree | 471897ffa0e6c19e5d2fe4317257bbfcb593fbf8 /gcc/gimplify.c | |
parent | 22518428af7aadf1ec1f5ba957e7ac4c8e9a6acb (diff) | |
download | gcc-33f0852f542c5aa80a0f16cc71a69870a7a754ca.zip gcc-33f0852f542c5aa80a0f16cc71a69870a7a754ca.tar.gz gcc-33f0852f542c5aa80a0f16cc71a69870a7a754ca.tar.bz2 |
re PR tree-optimization/69162 (ICE in create_tmp_var, at gimple-expr.c:468)
PR tree-optimization/69162
* gimplify.c (gimplify_va_arg_expr): Encode original type of
valist argument in another argument.
(gimplify_modify_expr): Adjust for the above change. Cleanup.
* tree-stdarg.c (expand_ifn_va_arg_1): Use new 3rd argument
to determine the va_list type, build a MEM_REF instead of
build_fold_indirect_ref.
* gcc.dg/pr69162.c: New test.
From-SVN: r232156
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 0887abc..ca66402 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -4724,12 +4724,12 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, tree type = TREE_TYPE (call); tree ap = CALL_EXPR_ARG (call, 0); tree tag = CALL_EXPR_ARG (call, 1); + tree aptag = CALL_EXPR_ARG (call, 2); tree newcall = build_call_expr_internal_loc (EXPR_LOCATION (call), IFN_VA_ARG, type, nargs + 1, ap, tag, - vlasize); - tree *call_p = &(TREE_OPERAND (*from_p, 0)); - *call_p = newcall; + aptag, vlasize); + TREE_OPERAND (*from_p, 0) = newcall; } } @@ -11501,7 +11501,7 @@ gimplify_va_arg_expr (tree *expr_p, gimple_seq *pre_p, tree promoted_type, have_va_type; tree valist = TREE_OPERAND (*expr_p, 0); tree type = TREE_TYPE (*expr_p); - tree t, tag; + tree t, tag, aptag; location_t loc = EXPR_LOCATION (*expr_p); /* Verify that valist is of the proper type. */ @@ -11555,7 +11555,10 @@ gimplify_va_arg_expr (tree *expr_p, gimple_seq *pre_p, } tag = build_int_cst (build_pointer_type (type), 0); - *expr_p = build_call_expr_internal_loc (loc, IFN_VA_ARG, type, 2, valist, tag); + aptag = build_int_cst (TREE_TYPE (valist), 0); + + *expr_p = build_call_expr_internal_loc (loc, IFN_VA_ARG, type, 3, + valist, tag, aptag); /* Clear the tentatively set PROP_gimple_lva, to indicate that IFN_VA_ARG needs to be expanded. */ |