[Patch, Fortran] PR 92793 - fix column used for error diagnostic
Thomas Schwinge
thomas@codesourcery.com
Fri Oct 30 10:47:00 GMT 2020
Hi!
On 2020-10-30T11:35:15+0100, I wrote:
> On 2019-12-04T14:37:55+0100, Tobias Burnus <tobias@codesourcery.com> wrote:
>> As reported internally by Frederik, gfortran currently passes
>> LOCATION_COLUMN == 0 to the middle end. The reason for that is how
>> parsing works – gfortran reads the input line by line.
>>
>> For internal error diagnostic (fortran/error.c), the column location was
>> corrected – but not for locations passed to the middle end. Hence, the
>> diagnostic there wasn't optimal.
>
> Thanks for fixing that aspect.
While working on something completely different -- of course... ;-) -- I
ran into:
>> Fixed by introducing a new function; now one only needs to make sure
>> that no new code will re-introduce "lb->location" :-)
... another *existing instance* of this problem.
>> - space = build_decl (sym->declared_at.lb->location,
>> + space = build_decl (gfc_get_location (&sym->declared_at),
The same change is required in
'gcc/fortran/trans.c:gfc_set_backend_locus'.
That took me a while to figure out... :-| In OMP offloading compilation
I saw diagnostics *with* column location information for C, C++, but the
very same diagnostics *without* column location information for Fortran.
Once I had some understood the Fortran front end locaiton processing --
uh... ;-\ -- I came up with the attached patch to "Further improve
Fortran column location information [PR92793]". OK to push? (No
testsuite regressions.)
Grüße
Thomas
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Further-improve-Fortran-column-location-information-.patch
Type: text/x-diff
Size: 4988 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20201030/4f6d0d25/attachment.bin>
More information about the Fortran
mailing list