Commit 6f719560 by Jakub Jelinek Committed by Jakub Jelinek

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
parent e0eb05ea
2007-04-26 Jakub Jelinek <jakub@redhat.com> 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 PR tree-optimization/30558
* tree-eh.c (lower_eh_filter): If EH_FILTER_MUST_NOT_THROW * tree-eh.c (lower_eh_filter): If EH_FILTER_MUST_NOT_THROW
clear this_state.prev_try. clear this_state.prev_try.
......
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> 2007-04-24 Mark Mitchell <mark@codesourcery.com>
PR c++/31338 PR c++/31338
......
...@@ -3627,7 +3627,8 @@ finish_omp_clauses (tree clauses) ...@@ -3627,7 +3627,8 @@ finish_omp_clauses (tree clauses)
Save the results, because later we won't be in the right context Save the results, because later we won't be in the right context
for making these queries. */ for making these queries. */
if (CLASS_TYPE_P (inner_type) 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; int save_errorcount = errorcount;
tree info; tree info;
......
2007-04-26 Jakub Jelinek <jakub@redhat.com> 2007-04-26 Jakub Jelinek <jakub@redhat.com>
PR c++/31598
* g++.dg/gomp/pr31598.C: New test.
PR tree-optimization/30558 PR tree-optimization/30558
* g++.dg/gomp/pr30558.C: New test. * g++.dg/gomp/pr30558.C: New test.
// 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) ...@@ -731,7 +731,7 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
(NULL_TREE, (NULL_TREE,
id->eh_region_offset + TREE_INT_CST_LOW (TREE_OPERAND (*tp, 0))); 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); TREE_TYPE (*tp) = remap_type (TREE_TYPE (*tp), id);
/* The copied TARGET_EXPR has never been expanded, even if the /* The copied TARGET_EXPR has never been expanded, even if the
......
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