diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9d3ba56ca53..f6d48e7f494 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-03-10 Jakub Jelinek + + PR middle-end/35099 + * tree-cfg.c (new_label_mapper): Update cfun->last_label_uid. + 2008-03-10 H.J. Lu PR tree-optimization/35494 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d4cb32611cb..5cefdef4011 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-03-10 Jakub Jelinek + + PR middle-end/35099 + * g++.dg/gomp/pr35099.C: New test. + 2008-03-10 Eric Botcazou * gnat.dg/range_check2.adb: New test. diff --git a/gcc/testsuite/g++.dg/gomp/pr35099.C b/gcc/testsuite/g++.dg/gomp/pr35099.C new file mode 100644 index 00000000000..6c793a3f8c2 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/pr35099.C @@ -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 (); + } +} diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index f98c684471e..5e551aa4517 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -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);