backport: re PR c++/59297 (ICE: openmp atomic with indirect LHS)
Backported from mainline 2013-11-28 Jakub Jelinek <jakub@redhat.com> PR c++/59297 * semantics.c (finish_omp_atomic): Call finish_expr_stmt rather than add_stmt. * g++.dg/gomp/pr59297.C: New test. 2013-05-31 Jason Merrill <jason@redhat.com> PR c++/56930 * semantics.c (potential_constant_expression_1): Handle OMP_ATOMIC*. From-SVN: r210178
This commit is contained in:
parent
a4639ccb03
commit
89fc3a0ffe
|
@ -1,11 +1,22 @@
|
|||
2014-05-07 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
Backported from mainline
|
||||
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-09-09 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/58325
|
||||
* init.c (build_vec_delete): Call mark_rvalue_use on base.
|
||||
|
||||
2013-05-31 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/56930
|
||||
* semantics.c (potential_constant_expression_1): Handle OMP_ATOMIC*.
|
||||
|
||||
2014-02-26 Fabien Chêne <fabien@gcc.gnu.org>
|
||||
|
||||
PR c++/37140
|
||||
|
|
|
@ -4977,7 +4977,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);
|
||||
}
|
||||
add_stmt (stmt);
|
||||
finish_expr_stmt (stmt);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -8594,6 +8594,12 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags)
|
|||
}
|
||||
return false;
|
||||
|
||||
case OMP_ATOMIC:
|
||||
case OMP_ATOMIC_READ:
|
||||
case OMP_ATOMIC_CAPTURE_OLD:
|
||||
case OMP_ATOMIC_CAPTURE_NEW:
|
||||
return false;
|
||||
|
||||
default:
|
||||
sorry ("unexpected AST of kind %s", tree_code_name[TREE_CODE (t)]);
|
||||
gcc_unreachable();
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
2014-05-07 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
Backported from mainline
|
||||
2013-11-28 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/59297
|
||||
* g++.dg/gomp/pr59297.C: New test.
|
||||
|
||||
2013-11-27 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/59014
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
// 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]);
|
||||
}
|
Loading…
Reference in New Issue