This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH fortran/linemap] Add enough column hint to fit any possible offset
- From: Tobias Burnus <burnus at net-b dot de>
- To: Manuel López-Ibáñez <lopezibanez at gmail dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>, "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>, Dodji Seketeli <dodji at redhat dot com>
- Date: Tue, 02 Dec 2014 07:50:05 +0100
- Subject: Re: [PATCH fortran/linemap] Add enough column hint to fit any possible offset
- Authentication-results: sourceware.org; auth=none
- References: <CAESRpQCNKPOsYZRg87nC2zdKtWxVaGbNw-XVC6A7gVzccWzoGQ at mail dot gmail dot com>
Hi Manuel,
Manuel López-Ibáñez wrote:
This patch actually does not touch linemap but I will appreciate
Dodji's comments about the approach. The problem is that in case of
long lines, the column hint of 120 might be too small, thus we do not
have enough locations within one line to point to a higher column
(like 132 in the testcase). Giving as column hint the length of the
line seems the right fix.
[...]
My fix here is to create a dummy location for line_len -1 (the last column in the line). This forces the next map to start after this last column's location.
My feeling is that that doesn't work for
-ffree-line-length-none/-ffixed-line-length-none. In that case,
gfc_option.free_line_length == 0 and there is no limit to the number of
characters per line. Thus, I fear that
b->location
- = linemap_line_start (line_table, current_file->line++, 120);
+ = linemap_line_start (line_table, current_file->line++, line_len);
might even set the line length to 0 – but I haven't checked. For all
other values, it should work.
Tobias