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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-11-07
                 CC|                            |burnus at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
            Summary|gfortran.dg/continuation_6. |[9/10 Regression]
                   |f fails when using latest   |gfortran.dg/continuation_6.
                   |glibc                       |f fails when using
                   |                            |-pre_include as done with
                   |                            |latest glibc
     Ever confirmed|0                           |1

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
CC Martin as he added -pre_include in r266509 for GCC 9 ("Support simd function
declarations via a pre-include.").


The problem is that the continuation-line count is off by the number of lines
in the -pre_include file – if you add as many additional lines as are in the
-pre_include file, the diagnostic works.

It also works if one forcefully sets "line_head = NULL" after the
"load_file (flag_pre_include" call in fortran/scanner.c's gfc_new_file.

I tried to set various other flags to 0, but it didn't make a difference.

The problem is that
      if (gfc_linebuf_linenum (gfc_current_locus.lb) == continue_line + 1)
is not entered for the first continuation line but only for the
#lines<math-vector-fortran.h>-th line.

And the continue_line is:
          if (gfc_current_locus.lb != NULL
              && continue_line < gfc_linebuf_linenum (gfc_current_locus.lb))
            continue_line = gfc_linebuf_linenum (gfc_current_locus.lb);

In terms of linemap_add calls, it doesn't look too bad, however. One has:
* LC_ENTER for continuation_6.f via f95-lang.c's gfc_init.
* LC_RENAME to "<built-in>"  (next line)
* LC_ENTER math-vector-fortran.h gfc_new_file -> load_file (pre_include
* LC_LEAVE  (and of load_file)
And then load_file (gfc_source_file is called, which starts with an LC_RENAME
to  "continuation_6.f".

Reply via email to