* [committed] Fix ICE with omp declare simd in BLOCK DATA (PR fortran/72716)
@ 2016-08-08 19:57 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2016-08-08 19:57 UTC (permalink / raw)
To: gcc-patches; +Cc: fortran
Hi!
We reject the statement later on, because it is not allowed in block data,
but if we stick it into the block data ns anyway, we ICE later on during
diagnostics.
Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
committed to trunk, queued for 6.2.
2016-08-08 Jakub Jelinek <jakub@redhat.com>
PR fortran/72716
* openmp.c (gfc_match_omp_declare_simd): Don't stick anything into
BLOCK DATA ns, it will be rejected later.
* gfortran.dg/gomp/pr72716.f90: New test.
--- gcc/fortran/openmp.c.jj 2016-07-16 10:41:04.000000000 +0200
+++ gcc/fortran/openmp.c 2016-08-08 15:36:30.638892714 +0200
@@ -2000,6 +2000,12 @@ gfc_match_omp_declare_simd (void)
false) != MATCH_YES)
return MATCH_ERROR;
+ if (gfc_current_ns->is_block_data)
+ {
+ gfc_free_omp_clauses (c);
+ return MATCH_YES;
+ }
+
ods = gfc_get_omp_declare_simd ();
ods->where = where;
ods->proc_name = proc_name;
--- gcc/testsuite/gfortran.dg/gomp/pr72716.f90.jj 2016-08-08 15:47:07.747170888 +0200
+++ gcc/testsuite/gfortran.dg/gomp/pr72716.f90 2016-08-08 15:48:50.036930905 +0200
@@ -0,0 +1,6 @@
+! PR fortran/72716
+! { dg-do compile }
+
+block data
+ !$omp declare simd (z) ! { dg-error "statement is not allowed inside of BLOCK DATA" }
+end block data
Jakub
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-08-08 19:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-08 19:57 [committed] Fix ICE with omp declare simd in BLOCK DATA (PR fortran/72716) Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).