diff options
author | Jason Merrill <jason@redhat.com> | 2014-01-27 23:30:38 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-01-27 23:30:38 -0500 |
commit | 30f6b7844aad824eb90adc0962a3663c73d5aa16 (patch) | |
tree | 0f49ec2595909b7586b1450c40952ac057dbf374 /gcc | |
parent | 9cca4e3d1a29de999ebdab84ffa99aa11eedf64e (diff) | |
download | gcc-30f6b7844aad824eb90adc0962a3663c73d5aa16.zip gcc-30f6b7844aad824eb90adc0962a3663c73d5aa16.tar.gz gcc-30f6b7844aad824eb90adc0962a3663c73d5aa16.tar.bz2 |
re PR c++/58814 (ICE with volatile and attribute vector_size)
PR c++/58814
* typeck.c (cp_build_modify_expr): Make the RHS an rvalue before
stabilizing.
From-SVN: r207163
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/vector25.C | 6 |
3 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 42adc48..b5693f2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2014-01-27 Jason Merrill <jason@redhat.com> + PR c++/58814 + * typeck.c (cp_build_modify_expr): Make the RHS an rvalue before + stabilizing. + PR c++/58837 * typeck.c (cp_truthvalue_conversion): Use explicit comparison for FUNCTION_DECL. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index b7ece1b..6268f7b 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -7399,8 +7399,7 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, side effect associated with any single compound assignment operator. -- end note ] */ lhs = stabilize_reference (lhs); - if (TREE_SIDE_EFFECTS (rhs)) - rhs = mark_rvalue_use (rhs); + rhs = rvalue (rhs); rhs = stabilize_expr (rhs, &init); newrhs = cp_build_binary_op (input_location, modifycode, lhs, rhs, diff --git a/gcc/testsuite/g++.dg/ext/vector25.C b/gcc/testsuite/g++.dg/ext/vector25.C new file mode 100644 index 0000000..6c1f5d0 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/vector25.C @@ -0,0 +1,6 @@ +volatile int i __attribute__((vector_size(8))); + +void foo() +{ + i += i; +} |