public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/98011] New: [OpenACC] 'gcc/fortran/scanner.c:load_line' should consider 'flag_openacc' in addition to 'flag_openmp' (and vice versa?)?
@ 2020-11-26 10:59 tschwinge at gcc dot gnu.org
  2020-11-26 11:41 ` [Bug fortran/98011] " burnus at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2020-11-26 10:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98011

            Bug ID: 98011
           Summary: [OpenACC] 'gcc/fortran/scanner.c:load_line' should
                    consider 'flag_openacc' in addition to 'flag_openmp'
                    (and vice versa?)?
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: openacc
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: burnus at gcc dot gnu.org, jakub at gcc dot gnu.org
  Target Milestone: ---

It's not obvious (to me, at least), why in 'gcc/fortran/scanner.c:load_line'
'flag_openmp' and 'flag_openacc' are handled differently:

    /* For truncation and tab warnings, set seen_comment to false if one has
       either an OpenMP or OpenACC directive - or a !GCC$ attribute.  If
       OpenMP is enabled, use '!$' as as conditional compilation sentinel
       and OpenMP directive ('!$omp').  */
    if (seen_comment && first_comment && flag_openmp && comment_ix + 1 == i
        && c == '$')
      first_comment = seen_comment = false;
    if (seen_comment && first_comment && comment_ix + 4 == i)
      {
        if (((*pbuf)[comment_ix+1] == 'g' || (*pbuf)[comment_ix+1] == 'G')
            && ((*pbuf)[comment_ix+2] == 'c' || (*pbuf)[comment_ix+2] == 'C')
            && ((*pbuf)[comment_ix+3] == 'c' || (*pbuf)[comment_ix+3] == 'C')
            && c == '$')
          first_comment = seen_comment = false;
        if (flag_openacc
            && (*pbuf)[comment_ix+1] == '$'
            && ((*pbuf)[comment_ix+2] == 'a' || (*pbuf)[comment_ix+2] == 'A')
            && ((*pbuf)[comment_ix+3] == 'c' || (*pbuf)[comment_ix+3] == 'C')
            && (c == 'c' || c == 'C'))
          first_comment = seen_comment = false;
      }

Shouldn't this also be handled vice versa?

If that indeed is meant to be different, then let's please add some "dummy
handling"/commentary to make this explicit, to show that we did consider this.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-10-15 21:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-26 10:59 [Bug fortran/98011] New: [OpenACC] 'gcc/fortran/scanner.c:load_line' should consider 'flag_openacc' in addition to 'flag_openmp' (and vice versa?)? tschwinge at gcc dot gnu.org
2020-11-26 11:41 ` [Bug fortran/98011] " burnus at gcc dot gnu.org
2020-11-26 11:59 ` burnus at gcc dot gnu.org
2020-11-30 14:37 ` cvs-commit at gcc dot gnu.org
2020-11-30 14:48 ` burnus at gcc dot gnu.org
2023-10-15 21:12 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).