diff options
author | Jason Merrill <jason@redhat.com> | 2016-05-23 17:21:24 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2016-05-23 17:21:24 -0400 |
commit | 290279c4380abb665ae8c0c798225e6efcecdf01 (patch) | |
tree | d4b16ed0f2546dd6bb9ca1f980b1676e3e214f8e | |
parent | 9c62c1f364223023698e03e52b3ca3c7cb1cb99b (diff) | |
download | gcc-290279c4380abb665ae8c0c798225e6efcecdf01.zip gcc-290279c4380abb665ae8c0c798225e6efcecdf01.tar.gz gcc-290279c4380abb665ae8c0c798225e6efcecdf01.tar.bz2 |
PR c++/70584 - error with parenthesized builtin arg
* cp-gimplify.c (cp_fold) [INDIRECT_REF]: Call
maybe_undo_parenthesized_ref.
From-SVN: r236616
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/cp-gimplify.c | 11 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/i386-10.C | 12 |
3 files changed, 26 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 232acc6..a93439c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2016-05-23 Jason Merrill <jason@redhat.com> + 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 de04bcb..eeba268 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 0000000..96def72 --- /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)); +} |