This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pr29759


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]