From 5c386a95ee20b9bb8f705ed1f8394ca7b4bafa7d Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 24 Nov 2006 22:28:38 +0100 Subject: re PR c/29955 (ICE with -fopenmp -fexceptions) PR c/29955 * c-tree.h (c_maybe_initialize_eh): New prototype. * c-decl.c (finish_decl): Move EH initialization... (c_maybe_initialize_eh): ... here. New function. * c-parser.c (c_parser_omp_construct): Call c_maybe_initialize_eh if not #pragma omp atomic. * gcc.dg/gomp/pr29955.c: New test. From-SVN: r119168 --- gcc/c-parser.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/c-parser.c') diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 8520253..c6be639 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -7755,6 +7755,12 @@ c_parser_omp_construct (c_parser *parser) p_kind = c_parser_peek_token (parser)->pragma_kind; c_parser_consume_pragma (parser); + /* For all constructs below except #pragma omp atomic + MUST_NOT_THROW catch handlers are needed when exceptions + are enabled. */ + if (p_kind != PRAGMA_OMP_ATOMIC) + c_maybe_initialize_eh (); + switch (p_kind) { case PRAGMA_OMP_ATOMIC: -- cgit v1.1