]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR c++/91987
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Oct 2019 07:36:07 +0000 (07:36 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Oct 2019 07:36:07 +0000 (07:36 +0000)
commit9b2b5ad0e8c0eac196f2aaba1ad6ba26f9596d1e
treefe29653bb010efc768398510adcd8af902405b71
parent43c3467f12d54c1daf1b7591eff5f4255f1dee8d
PR c++/91987
cp/
* decl2.c (grok_array_decl): For -fstrong-eval-order, when array ref
operands have been swapped and at least one operand has side-effects,
revert the swapping before calling build_array_ref.
* typeck.c (cp_build_array_ref): For non-ARRAY_TYPE array ref with
side-effects on the index operand, if -fstrong-eval-order use
save_expr around the array operand.
(cp_build_binary_op): For shifts with side-effects in the second
operand, wrap first operand into SAVE_EXPR and evaluate it before
the shift.
* semantics.c (handle_omp_array_sections_1): Temporarily disable
flag_strong_eval_order during OMP_CLAUSE_REDUCTION array section
processing.
* cp-gimplify.c (gimplify_to_rvalue): New function.
(cp_gimplify_expr): Use it.
testsuite/
* g++.dg/cpp1z/eval-order6.C: New test.
* g++.dg/cpp1z/eval-order7.C: New test.
* g++.dg/cpp1z/eval-order8.C: New test.
* c-c++-common/gomp/pr91987.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@276860 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/cp-gimplify.c
gcc/cp/decl2.c
gcc/cp/semantics.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/gomp/pr91987.c [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/eval-order6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/eval-order7.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/eval-order8.C [new file with mode: 0644]