From: Jason Merrill Date: Mon, 23 May 2016 21:21:24 +0000 (-0400) Subject: PR c++/70584 - error with parenthesized builtin arg X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=290279c4380abb665ae8c0c798225e6efcecdf01;p=gcc.git PR c++/70584 - error with parenthesized builtin arg * cp-gimplify.c (cp_fold) [INDIRECT_REF]: Call maybe_undo_parenthesized_ref. From-SVN: r236616 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 232acc6772b..a93439cc7dc 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2016-05-23 Jason Merrill + PR c++/70584 + * cp-gimplify.c (cp_fold) [INDIRECT_REF]: Call + maybe_undo_parenthesized_ref. + PR c++/70735 * pt.c (tsubst_copy): Just return a local variable from non-template context. Don't call rest_of_decl_compilation for diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index de04bcbb190..eeba26829b7 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -1996,6 +1996,15 @@ cp_fold (tree x) break; + case INDIRECT_REF: + /* We don't need the decltype(auto) obfuscation anymore. */ + if (REF_PARENTHESIZED_P (x)) + { + tree p = maybe_undo_parenthesized_ref (x); + return cp_fold_maybe_rvalue (p, rval_ops); + } + goto unary; + case ADDR_EXPR: case REALPART_EXPR: case IMAGPART_EXPR: @@ -2008,7 +2017,7 @@ cp_fold (tree x) case BIT_NOT_EXPR: case TRUTH_NOT_EXPR: case FIXED_CONVERT_EXPR: - case INDIRECT_REF: + unary: loc = EXPR_LOCATION (x); op0 = cp_fold_maybe_rvalue (TREE_OPERAND (x, 0), rval_ops); diff --git a/gcc/testsuite/g++.dg/other/i386-10.C b/gcc/testsuite/g++.dg/other/i386-10.C new file mode 100644 index 00000000000..96def72f8f0 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/i386-10.C @@ -0,0 +1,12 @@ +// { dg-do compile { target i?86-*-* x86_64-*-* } } +// { dg-options -maes } + +typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); + +int main() +{ + const char index = 1; + __m128i r = { }; + + r = __builtin_ia32_aeskeygenassist128 (r, (int)(index)); +}