Commit 9fa6cfec by Tobias Burnus Committed by Tobias Burnus

re PR fortran/33445 (Diagnose "!$OMP&" as an error in free format unless it is a continuation line)

2007-09-22  Tobias Burnus  <burnus@net-b.de>

        PR fortran/33445
        * scanner.c (skip_free_comments): Warn if !$OMP& is used
        if no OpenMP directive is to be continued.

2007-09-22  Tobias Burnus  <burnus@net-b.de>

        PR fortran/33445
        * gfortran.dg/gomp/free-2.f90: New.
        * gfortran.dg/gomp/appendix-a/a.31.1.f90: Add missing &.
        * gfortran.dg/gomp/omp_parse1.f90: Add dg-warning.

From-SVN: r128670
parent b235734c
2007-09-22 Tobias Burnus <burnus@net-b.de>
PR fortran/33445
* scanner.c (skip_free_comments): Warn if !$OMP& is used
if no OpenMP directive is to be continued.
2007-09-21 Paul Thomas <pault@gcc.gnu.org> 2007-09-21 Paul Thomas <pault@gcc.gnu.org>
*trans-expr.c (gfc_trans_pointer_assignment): Convert array *trans-expr.c (gfc_trans_pointer_assignment): Convert array
......
...@@ -417,18 +417,25 @@ skip_free_comments (void) ...@@ -417,18 +417,25 @@ skip_free_comments (void)
if (c == 'o' || c == 'O') if (c == 'o' || c == 'O')
{ {
if (((c = next_char ()) == 'm' || c == 'M') if (((c = next_char ()) == 'm' || c == 'M')
&& ((c = next_char ()) == 'p' || c == 'P') && ((c = next_char ()) == 'p' || c == 'P'))
&& ((c = next_char ()) == ' ' || continue_flag))
{ {
while (gfc_is_whitespace (c)) if ((c = next_char ()) == ' ' || continue_flag)
c = next_char ();
if (c != '\n' && c != '!')
{ {
openmp_flag = 1; while (gfc_is_whitespace (c))
openmp_locus = old_loc; c = next_char ();
gfc_current_locus = start; if (c != '\n' && c != '!')
return false; {
openmp_flag = 1;
openmp_locus = old_loc;
gfc_current_locus = start;
return false;
}
} }
else
gfc_warning_now ("!$OMP at %C starts a commented "
"line as it neither is followed "
"by a space nor is a "
"continuation line");
} }
gfc_current_locus = old_loc; gfc_current_locus = old_loc;
next_char (); next_char ();
......
2007-09-22 Tobias Burnus <burnus@net-b.de>
PR fortran/33445
* gfortran.dg/gomp/free-2.f90: New.
* gfortran.dg/gomp/appendix-a/a.31.1.f90: Add missing &.
* gfortran.dg/gomp/omp_parse1.f90: Add dg-warning.
2007-09-22 Uros Bizjak <ubizjak@gmail.com> 2007-09-22 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/sse5-hadduX.c: Remove target selector. * gcc.target/i386/sse5-hadduX.c: Remove target selector.
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
SUBROUTINE A31_1(A, B, X, Y, N) SUBROUTINE A31_1(A, B, X, Y, N)
INTEGER N INTEGER N
REAL X(*), Y(*), A, B REAL X(*), Y(*), A, B
!$OMP PARALLEL DO PRIVATE(I) SHARED(X, N) REDUCTION(+:A) !$OMP PARALLEL DO PRIVATE(I) SHARED(X, N) REDUCTION(+:A) &
!$OMP& REDUCTION(MIN:B) !$OMP& REDUCTION(MIN:B)
DO I=1,N DO I=1,N
A = A + X(I) A = A + X(I)
......
! { dg-do compile }
!
! PR fortran/33445
!
!$OMP&foo ! { dg-warning "starts a commented line" }
!
!$OMP parallel
!$OMP& default(shared) ! { dg-warning "starts a commented line" }
!$OMP end parallel
!
!$OMP parallel
!$OMP+ default(shared) ! { dg-warning "starts a commented line" }
!$OMP end parallel
end
...@@ -17,7 +17,7 @@ call bar ...@@ -17,7 +17,7 @@ call bar
! Non-continuation !$omp must be followed by space, and my reading ! Non-continuation !$omp must be followed by space, and my reading
! doesn't seem to allow tab there. So such lines should be completely ! doesn't seem to allow tab there. So such lines should be completely
! ignored. ! ignored.
!$omp strange !$omp strange ! { dg-warning "starts a commented line" }
end end
! { dg-final { scan-tree-dump-times "pragma omp parallel" 3 "omplower" } } ! { dg-final { scan-tree-dump-times "pragma omp parallel" 3 "omplower" } }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment