From: Jakub Jelinek Date: Thu, 3 Aug 2017 08:34:16 +0000 (+0200) Subject: re PR middle-end/81052 (ICE in verify_dominators, at dominance.c:1184) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0a734553cc49e4767dfefa1328d1fb5cf464650b;p=gcc.git re PR middle-end/81052 (ICE in verify_dominators, at dominance.c:1184) PR middle-end/81052 * omp-low.c (diagnose_sb_0): Handle flag_openmp_simd like flag_openmp. (pass_diagnose_omp_blocks::gate): Enable also for flag_openmp_simd. * c-c++-common/pr81052.c: New test. From-SVN: r250847 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 16b03043c7a..a9b923a22fa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-08-03 Jakub Jelinek + + PR middle-end/81052 + * omp-low.c (diagnose_sb_0): Handle flag_openmp_simd like flag_openmp. + (pass_diagnose_omp_blocks::gate): Enable also for flag_openmp_simd. + 2017-08-03 Prathamesh Kulkarni * tree-vrp.h: Add include guard. diff --git a/gcc/omp-low.c b/gcc/omp-low.c index bf3fc53b07a..2e0973e06d1 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -9083,7 +9083,7 @@ diagnose_sb_0 (gimple_stmt_iterator *gsi_p, } if (kind == NULL) { - gcc_checking_assert (flag_openmp); + gcc_checking_assert (flag_openmp || flag_openmp_simd); kind = "OpenMP"; } @@ -9343,7 +9343,7 @@ public: /* opt_pass methods: */ virtual bool gate (function *) { - return flag_cilkplus || flag_openacc || flag_openmp; + return flag_cilkplus || flag_openacc || flag_openmp || flag_openmp_simd; } virtual unsigned int execute (function *) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a19e40f6a0a..a8077a53341 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-08-03 Jakub Jelinek + + PR middle-end/81052 + * c-c++-common/pr81052.c: New test. + 2017-08-03 Tom de Vries * gcc.dg/pr56727-2.c: Require alias. diff --git a/gcc/testsuite/c-c++-common/pr81052.c b/gcc/testsuite/c-c++-common/pr81052.c new file mode 100644 index 00000000000..6bc2879951e --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr81052.c @@ -0,0 +1,28 @@ +/* PR middle-end/81052 */ +/* { dg-do compile } */ +/* { dg-options "-fopenmp-simd -O2" } */ + +int +foo (int x, int y) +{ + int i; +#pragma omp simd + for (i = x; i < y; ++i) + return 0; /* { dg-error "invalid branch to/from OpenMP structured block" } */ + return 1; +} + +#ifdef __cplusplus +template +T +bar (T x, T y) +{ + T i; +#pragma omp simd + for (i = x; i < y; ++i) + return 0; /* { dg-error "invalid branch to/from OpenMP structured block" "" { target c++ } } */ + return 1; +} + +int x = bar (1, 7); +#endif