re PR c++/36237 (internal compiler error: in lower_stmt, at gimple-low.c:282 erase 'private(localTodoStack)' it compiles successfully.)

PR c++/36237
	* cp-gimplify.c (cxx_omp_clause_apply_fn): Call
	fold_build_cleanup_point_expr on build_call_a results.

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

From-SVN: r135802
This commit is contained in:
Jakub Jelinek 2008-05-23 15:21:47 +02:00 committed by Jakub Jelinek
parent cf38a465ec
commit c2898ec950
5 changed files with 43 additions and 5 deletions

View File

@ -1,5 +1,9 @@
2008-05-23 Jakub Jelinek <jakub@redhat.com>
PR c++/36237
* cp-gimplify.c (cxx_omp_clause_apply_fn): Call
fold_build_cleanup_point_expr on build_call_a results.
PR c++/36308
* semantics.c (omp_clause_info_fndecl): New function.
(finish_omp_clauses): Use it.

View File

@ -1,6 +1,6 @@
/* C++-specific tree lowering bits; see also c-gimplify.c and tree-gimple.c.
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by Jason Merrill <jason@redhat.com>
@ -784,7 +784,7 @@ cp_genericize (tree fndecl)
static tree
cxx_omp_clause_apply_fn (tree fn, tree arg1, tree arg2)
{
tree defparm, parm;
tree defparm, parm, t;
int i = 0;
int nargs;
tree *argarray;
@ -804,7 +804,7 @@ cxx_omp_clause_apply_fn (tree fn, tree arg1, tree arg2)
tree inner_type = TREE_TYPE (arg1);
tree start1, end1, p1;
tree start2 = NULL, p2 = NULL;
tree ret = NULL, lab, t;
tree ret = NULL, lab;
start1 = arg1;
start2 = arg2;
@ -849,6 +849,8 @@ cxx_omp_clause_apply_fn (tree fn, tree arg1, tree arg2)
argarray[i] = convert_default_arg (TREE_VALUE (parm),
TREE_PURPOSE (parm), fn, i);
t = build_call_a (fn, i, argarray);
t = fold_convert (void_type_node, t);
t = fold_build_cleanup_point_expr (TREE_TYPE (t), t);
append_to_statement_list (t, &ret);
t = TYPE_SIZE_UNIT (inner_type);
@ -881,7 +883,9 @@ cxx_omp_clause_apply_fn (tree fn, tree arg1, tree arg2)
argarray[i] = convert_default_arg (TREE_VALUE (parm),
TREE_PURPOSE (parm),
fn, i);
return build_call_a (fn, i, argarray);
t = build_call_a (fn, i, argarray);
t = fold_convert (void_type_node, t);
return fold_build_cleanup_point_expr (TREE_TYPE (t), t);
}
}

View File

@ -1,3 +1,8 @@
2008-05-23 Jakub Jelinek <jakub@redhat.com>
PR c++/36237
* g++.dg/gomp/pr36237.C: New test.
2008-05-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/builtins-error.c: Test __builtin_fpclassify. Also

View File

@ -0,0 +1,25 @@
// PR c++/36237
// { dg-do compile }
// { dg-options "-fopenmp" }
struct A
{
~A ();
};
struct B
{
B (const A &x = A ()) : a (x) { }
A a;
};
B var;
void bar ();
void
foo ()
{
#pragma omp parallel private (var)
bar ();
}

View File

@ -3,7 +3,7 @@
extern "C" void abort ();
static int ctors, dtors, copyctors, n, m;
static int n;
struct A
{