[Fortran] Truncate warn with OpenMP/OpenACC/!GCC$ (PR94709)
authorTobias Burnus <tobias@codesourcery.com>
Wed, 22 Apr 2020 12:07:55 +0000 (14:07 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Wed, 22 Apr 2020 12:07:55 +0000 (14:07 +0200)
commit4ea769a91dfa9142235c457b9db6ecc4e55072c4
tree79afc51e7d496f298b7bb7c9a8491b5bd7e06fa6
parent4a047a32782cfeb7c2265af5b607ac4c51a9f6cc
[Fortran] Truncate warn with OpenMP/OpenACC/!GCC$ (PR94709)

While '!$' with -fopenmp unsets too often load_line's seen_comment flag,
this only affects <tab> warnings; for trunction warnings, gfc_next_char_literal
re-handles the directives correctly.  In terms of missed warnings, a directive
that is completely in the truncated part is not diagnosted (as it starts
with a '!').

        PR fortran/94709
        * scanner.c (load_line): In fixed form, also treat 'C' as comment and
        'D'/'d' only with -fd-lines-as-comments. Treat '!$' with -fopenmp,
        '!$acc' with -fopenacc and '!GCC$' as non-comment to permit <tab>
        and truncation warnings.

        PR fortran/94709
        * gfortran.dg/gomp/warn_truncated.f: New.
        * gfortran.dg/gomp/warn_truncated.f90: New.
gcc/fortran/ChangeLog
gcc/fortran/scanner.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/gomp/warn_truncated.f [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/warn_truncated.f90 [new file with mode: 0644]