2014-07-07 Cesar Philippidis <cesar@codesourcery.com>
gcc/fortran/
* parse.c (next_fixed): Don't handle openmp pragmas when scanning
for openacc pragmas.
* gcc/fortran/scanner.c (gfc_next_char_literal): Fix the scan for
*$acc.
gcc/testsuite/
* gfortran.dg/goacc/fixed-3.f:
* gfortran.dg/goacc/fixed-4.f:
@@ -1071,9 +1071,15 @@ next_fixed (void)
return ST_NONE;
return decode_omp_directive ();
}
- else if ((gfc_option.gfc_flag_openmp
- || gfc_option.gfc_flag_openmp_simd)
- && gfc_option.gfc_flag_openacc)
+ else if (gfc_option.gfc_flag_openacc
+ && !(gfc_option.gfc_flag_openmp
+ || gfc_option.gfc_flag_openmp_simd))
+ {
+ if (!verify_token_fixed ("acc", 3, last_was_use_stmt))
+ return ST_NONE;
+ return decode_oacc_directive ();
+ }
+ else
{
c = gfc_next_char_literal(NONSTRING);
if (c == 'o' || c == 'O')
@@ -1089,12 +1095,6 @@ next_fixed (void)
return decode_oacc_directive ();
}
}
- else if (gfc_option.gfc_flag_openacc)
- {
- if (!verify_token_fixed ("acc", 3, last_was_use_stmt))
- return ST_NONE;
- return decode_oacc_directive ();
- }
}
/* FALLTHROUGH */
@@ -1462,10 +1462,10 @@ restart:
goto not_continuation;
}
else if (openacc_flag)
- for (i = 0; i > 5; i++)
+ for (i = 0; i < 5; i++)
{
c = next_char ();
- if (gfc_wide_tolower (c) != (unsigned char) "*$omp"[i])
+ if (gfc_wide_tolower (c) != (unsigned char) "*$acc"[i])
goto not_continuation;
}
new file mode 100644
@@ -0,0 +1,13 @@
+ IMPLICIT NONE
+
+ INTEGER DEV
+
+!$ACC PARALLEL
+ DEV = 0
+!$ACC END PARALLEL
+
+!$ACC PARALLEL
+ DEV = 0
+!$ACC END PARALLEL
+
+ END
new file mode 100644
@@ -0,0 +1,6 @@
+ IMPLICIT NONE
+
+!$ACC PARALLEL
+!$ACC END PARALLEL
+
+ END