Commit e3f505d8 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/59297 (ICE: openmp atomic with indirect LHS)

	PR c++/59297
	* semantics.c (finish_omp_atomic): Call finish_expr_stmt
	rather than add_stmt.

	* g++.dg/gomp/pr59297.C: New test.

From-SVN: r205500
parent 3dc87cc0
2013-11-28 Jakub Jelinek <jakub@redhat.com>
PR c++/59297
* semantics.c (finish_omp_atomic): Call finish_expr_stmt
rather than add_stmt.
2013-11-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2013-11-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* g++spec.c (TIMELIB): Define. * g++spec.c (TIMELIB): Define.
......
...@@ -6548,7 +6548,7 @@ finish_omp_atomic (enum tree_code code, enum tree_code opcode, tree lhs, ...@@ -6548,7 +6548,7 @@ finish_omp_atomic (enum tree_code code, enum tree_code opcode, tree lhs,
stmt = build2 (OMP_ATOMIC, void_type_node, integer_zero_node, stmt); stmt = build2 (OMP_ATOMIC, void_type_node, integer_zero_node, stmt);
OMP_ATOMIC_SEQ_CST (stmt) = seq_cst; OMP_ATOMIC_SEQ_CST (stmt) = seq_cst;
} }
add_stmt (stmt); finish_expr_stmt (stmt);
} }
void void
......
2013-11-28 Jakub Jelinek <jakub@redhat.com>
PR c++/59297
* g++.dg/gomp/pr59297.C: New test.
2013-11-28 Vladimir Makarov <vmakarov@redhat.com> 2013-11-28 Vladimir Makarov <vmakarov@redhat.com>
PR target/57293 PR target/57293
......
// PR c++/59297
// { dg-do compile }
// { dg-options "-fopenmp" }
template <typename T>
struct A
{
~A ();
const T &operator[] (int) const;
};
struct B
{
int &operator () (A <int>);
};
void
foo (B &x, int &z)
{
A<A<int> > y;
#pragma omp atomic
x (y[0]) += 1;
#pragma omp atomic
z += x(y[1]);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment