This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: pr29759
- From: "Daniel Franke" <franke dot daniel at gmail dot com>
- To: "Steve Kargl" <sgk at troutmask dot apl dot washington dot edu>
- Cc: fortran at gcc dot gnu dot org, jakub at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Fri, 10 Nov 2006 10:44:57 +0100
- Subject: Re: pr29759
- References: <640ad44b0611100142u7fc5259ep2cb9b195f1556935@mail.gmail.com>
Great, gmail removed the attachment ...
Here it is.
2006/11/10, Daniel Franke <franke.daniel@gmail.com>:
2006/11/10, Steve Kargl <sgk@troutmask.apl.washington.edu>:
> On Fri, Nov 10, 2006 at 01:17:49AM +0100, Daniel Franke wrote:
> >
> > please find attached a proposed fix for PR29759 (ICE on OMP line
> > continuation).
> >
> > The ICE occured because all lines starting with "!$" where checked
> > against "!$OMP", even if they were known OMP conditional lines. The
> > fix for this should qualify as obvious. Is a testcase needed?
> >
> > Regtested on i686-pc-linux-gnu.
> >
> > If it is acceptable, could someone commit it to trunk and 4.2?
> >
> > Thanks
>
> Daniel,
>
> You should CC your patch eamils to gcc-patches@gcc.gnu.org.
> I've CC'd Jakub in that he has handled most Fortran OpenMP
> stuff
>
> Yes, a testcase should be created. Just add
>
> ! { dg-do compile }
>
> to the top line of your small example. I'm not sure whether
> this should go in gfortran.dg or one of the gomp testsuites?
Steve,
I created a more complete testcase and added it to
testsuite/gfortran.dg/gomp as pr29759.f90. The patch
was updated accordingly.
Regtested on i686-pc-linux-gnu as
$> make check-gfortran RUNTESTFLAGS="gomp.exp"
Regards
Daniel
Index: gcc/fortran/scanner.c
===================================================================
--- gcc/fortran/scanner.c (revision 118592)
+++ gcc/fortran/scanner.c (working copy)
@@ -694,7 +694,7 @@
while (gfc_is_whitespace (c))
c = next_char ();
- if (openmp_flag)
+ if (openmp_flag && !openmp_cond_flag)
{
for (i = 0; i < 5; i++, c = next_char ())
{
Index: gcc/testsuite/gfortran.dg/gomp/pr29759.f90
===================================================================
--- gcc/testsuite/gfortran.dg/gomp/pr29759.f90 (revision 0)
+++ gcc/testsuite/gfortran.dg/gomp/pr29759.f90 (revision 0)
@@ -0,0 +1,40 @@
+! { dg-do compile }
+PROGRAM test_omp
+!$OMP PARALLEL &
+!$OMP NUM_THREADS(2)
+!$OMP END PARALLEL
+
+!$OMP PARALLEL &
+!$OMP & NUM_THREADS(2)
+!$OMP END PARALLEL
+
+!$OMP PARALLEL &
+!
+!$OMP NUM_THREADS(2)
+!$OMP END PARALLEL
+
+!$OMP PARALLEL &
+!
+!$OMP & NUM_THREADS(2)
+!$OMP END PARALLEL
+
+
+!$OMP PARALLEL &
+!$ NUM_THREADS(2)
+!$OMP END PARALLEL
+
+!$OMP PARALLEL &
+!$ & NUM_THREADS(2)
+!$OMP END PARALLEL
+
+!$OMP PARALLEL &
+!
+!$ NUM_THREADS(2)
+!$OMP END PARALLEL
+
+!$OMP PARALLEL &
+!
+!$ & NUM_THREADS(2)
+!$OMP END PARALLEL
+
+END PROGRAM