re PR middle-end/35099 (ICE in remove_unreachable_regions with -O -fopenmp)

PR middle-end/35099
	* tree-cfg.c (new_label_mapper): Update cfun->last_label_uid.

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

From-SVN: r133084
This commit is contained in:
Jakub Jelinek 2008-03-10 20:39:30 +01:00 committed by Jakub Jelinek
parent e1e7141cf3
commit 8b46837cd1
4 changed files with 51 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2008-03-10 Jakub Jelinek <jakub@redhat.com>
PR middle-end/35099
* tree-cfg.c (new_label_mapper): Update cfun->last_label_uid.
2008-03-10 H.J. Lu <hongjiu.lu@intel.com>
PR tree-optimization/35494

View File

@ -1,3 +1,8 @@
2008-03-10 Jakub Jelinek <jakub@redhat.com>
PR middle-end/35099
* g++.dg/gomp/pr35099.C: New test.
2008-03-10 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/range_check2.adb: New test.

View File

@ -0,0 +1,39 @@
// PR middle-end/35099
// { dg-do compile }
// { dg-options "-O2 -fopenmp" }
struct A
{
~A () throw ();
void foo ();
};
struct B
{
B () { A ().foo (); }
};
void
bar ()
{
#pragma omp parallel
{
#pragma omp single
B ();
#pragma omp for
for (int i = 0; i < 2; ++i)
B ();
}
}
void
baz ()
{
#pragma omp parallel
{
#pragma omp single
B ();
#pragma omp single
B ();
}
}

View File

@ -5895,6 +5895,8 @@ new_label_mapper (tree decl, void *data)
m->base.from = decl;
m->to = create_artificial_label ();
LABEL_DECL_UID (m->to) = LABEL_DECL_UID (decl);
if (LABEL_DECL_UID (m->to) >= cfun->last_label_uid)
cfun->last_label_uid = LABEL_DECL_UID (m->to) + 1;
slot = htab_find_slot_with_hash (hash, m, m->hash, INSERT);
gcc_assert (*slot == NULL);