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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jsm28 at gcc dot gnu.org,
                   |                            |rth at gcc dot gnu.org

--- Comment #13 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Patrick Palka from comment #12)
> Would it be a good idea to make the C frontend behave more like the C++
> frontend w.r.t. updating input_location? The behavior of the C++ frontend
> seems more sensible to me. And I think such a change would fix this PR.

As far as I know, everything that reduces spurious differences between C and
C++ FEs is welcome. Lexing at start-up is supposedly faster, thus any changes
in that direction should be acceptable (but I'm not a C maintainer, so better
ask them).

I'm afraid that wholesale changing the C FE behavior is going to lead to a lot
of subtle regressions. Using something like
c_parser_peek_token_keep_input_location allows changing the code case by case
and being able to point out which commit introduced a bug.

Removing uses of input_location throughout the compiler would also help. For
example, by passing an explicit location to c_finish_loop and using that for
the exit node.

Reply via email to