Commit 8a8c12a3 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/49223 (Internal compiler error when using OpenMP)

	PR c++/49223
	* semantics.c (finish_omp_clauses): Call require_complete_type
	even for copyin/copyprivate clauses.  Only call
	cxx_omp_create_clause_info if inner_type is COMPLETE_TYPE_P.

	* g++.dg/gomp/pr49223-1.C: New test.
	* g++.dg/gomp/pr49223-2.C: New test.

From-SVN: r174432
parent c87765d6
2011-05-30 Jakub Jelinek <jakub@redhat.com>
PR c++/49223
* semantics.c (finish_omp_clauses): Call require_complete_type
even for copyin/copyprivate clauses. Only call
cxx_omp_create_clause_info if inner_type is COMPLETE_TYPE_P.
2011-05-28 Jason Merrill <jason@redhat.com> 2011-05-28 Jason Merrill <jason@redhat.com>
PR c++/46124 PR c++/46124
......
...@@ -4042,12 +4042,13 @@ finish_omp_clauses (tree clauses) ...@@ -4042,12 +4042,13 @@ finish_omp_clauses (tree clauses)
break; break;
} }
if (need_complete_non_reference) if (need_complete_non_reference || need_copy_assignment)
{ {
t = require_complete_type (t); t = require_complete_type (t);
if (t == error_mark_node) if (t == error_mark_node)
remove = true; remove = true;
else if (TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE) else if (TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE
&& need_complete_non_reference)
{ {
error ("%qE has reference type for %qs", t, name); error ("%qE has reference type for %qs", t, name);
remove = true; remove = true;
...@@ -4089,6 +4090,7 @@ finish_omp_clauses (tree clauses) ...@@ -4089,6 +4090,7 @@ 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)
&& COMPLETE_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) && !type_dependent_expression_p (t)
&& cxx_omp_create_clause_info (c, inner_type, need_default_ctor, && cxx_omp_create_clause_info (c, inner_type, need_default_ctor,
......
2011-05-30 Jakub Jelinek <jakub@redhat.com>
PR c++/49223
* g++.dg/gomp/pr49223-1.C: New test.
* g++.dg/gomp/pr49223-2.C: New test.
2011-05-30 Richard Guenther <rguenther@suse.de> 2011-05-30 Richard Guenther <rguenther@suse.de>
PR tree-optimization/49218 PR tree-optimization/49218
......
// PR c++/49223
// { dg-do compile }
// { dg-options "-fopenmp" }
template <int N>
struct V
{
V () {}
~V () {}
};
template <int N>
struct S
{
void foo ()
{
V <0> v;
#pragma omp parallel private (v)
;
}
};
void
bar (void)
{
S <0> s;
s.foo ();
}
// PR c++/49223
// { dg-do compile }
// { dg-require-effective-target tls }
// { dg-options "-fopenmp" }
struct S; // { dg-error "forward declaration" }
extern __thread struct S s; // { dg-error "has incomplete type" }
struct T;
extern __thread struct T t;
void
foo ()
{
#pragma omp parallel copyin (s)
;
}
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