mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-22 15:11:15 +08:00
re PR c++/31598 (g++ does not accept some OpenMP code)
PR c++/31598 * tree-inline.c (copy_body_r): Don't touch TREE_TYPE of OMP_CLAUSE. * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO for type dependent OMP_CLAUSE_DECLs. * g++.dg/gomp/pr31598.C: New test. From-SVN: r124178
This commit is contained in:
parent
e0eb05eaa1
commit
6f7195603e
@ -1,5 +1,8 @@
|
||||
2007-04-26 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/31598
|
||||
* tree-inline.c (copy_body_r): Don't touch TREE_TYPE of OMP_CLAUSE.
|
||||
|
||||
PR tree-optimization/30558
|
||||
* tree-eh.c (lower_eh_filter): If EH_FILTER_MUST_NOT_THROW
|
||||
clear this_state.prev_try.
|
||||
|
@ -1,3 +1,9 @@
|
||||
2007-04-26 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/31598
|
||||
* semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
|
||||
for type dependent OMP_CLAUSE_DECLs.
|
||||
|
||||
2007-04-24 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/31338
|
||||
|
@ -3627,7 +3627,8 @@ finish_omp_clauses (tree clauses)
|
||||
Save the results, because later we won't be in the right context
|
||||
for making these queries. */
|
||||
if (CLASS_TYPE_P (inner_type)
|
||||
&& (need_default_ctor || need_copy_ctor || need_copy_assignment))
|
||||
&& (need_default_ctor || need_copy_ctor || need_copy_assignment)
|
||||
&& !type_dependent_expression_p (t))
|
||||
{
|
||||
int save_errorcount = errorcount;
|
||||
tree info;
|
||||
|
@ -1,5 +1,8 @@
|
||||
2007-04-26 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/31598
|
||||
* g++.dg/gomp/pr31598.C: New test.
|
||||
|
||||
PR tree-optimization/30558
|
||||
* g++.dg/gomp/pr30558.C: New test.
|
||||
|
||||
|
59
gcc/testsuite/g++.dg/gomp/pr31598.C
Normal file
59
gcc/testsuite/g++.dg/gomp/pr31598.C
Normal file
@ -0,0 +1,59 @@
|
||||
// PR c++/31598
|
||||
// { dg-do compile }
|
||||
//
|
||||
// Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
// Contributed by Theodore.Papadopoulo
|
||||
// 16 Apr 2007 <Theodore.Papadopoulo@sophia.inria.fr>
|
||||
|
||||
int i;
|
||||
template <typename> struct A { A() {} };
|
||||
template <typename> struct C { C() { i++; } C(const C &) { i += 2; } };
|
||||
struct D { D() {} };
|
||||
|
||||
struct M { typedef double E; };
|
||||
|
||||
template <typename T>
|
||||
struct R
|
||||
{
|
||||
R()
|
||||
{
|
||||
typedef A<typename T::E> B;
|
||||
B b;
|
||||
#pragma omp parallel for firstprivate(b) schedule(guided)
|
||||
for (int t = 0; t < 10; ++t)
|
||||
;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct S
|
||||
{
|
||||
S()
|
||||
{
|
||||
typedef C<typename T::E> B;
|
||||
B b;
|
||||
#pragma omp parallel for firstprivate(b)
|
||||
for (int t = 0; t < 10; ++t)
|
||||
;
|
||||
}
|
||||
};
|
||||
|
||||
struct U
|
||||
{
|
||||
U()
|
||||
{
|
||||
D b;
|
||||
#pragma omp parallel for firstprivate(b)
|
||||
for (int t = 0; t < 10; ++t)
|
||||
;
|
||||
}
|
||||
};
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
R<M> r;
|
||||
S<M> s;
|
||||
U u;
|
||||
return 0;
|
||||
}
|
@ -731,7 +731,7 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
|
||||
(NULL_TREE,
|
||||
id->eh_region_offset + TREE_INT_CST_LOW (TREE_OPERAND (*tp, 0)));
|
||||
|
||||
if (!GIMPLE_TUPLE_P (*tp))
|
||||
if (!GIMPLE_TUPLE_P (*tp) && TREE_CODE (*tp) != OMP_CLAUSE)
|
||||
TREE_TYPE (*tp) = remap_type (TREE_TYPE (*tp), id);
|
||||
|
||||
/* The copied TARGET_EXPR has never been expanded, even if the
|
||||
|
Loading…
x
Reference in New Issue
Block a user