substring locations and # line directives (PR preprocessor/78569)
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 30 Nov 2016 01:13:37 +0000 (01:13 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 30 Nov 2016 01:13:37 +0000 (01:13 +0000)
commit94f597df228750eec6d5c28134edd45022b0394a
tree977d5229cdf9b708bbd2e09cc532aab26e12f656
parent3517d13be77399582c2068eb2c26881864ed110e
substring locations and # line directives (PR preprocessor/78569)

The ICE in PR preprocessor/78569 appears to be due to an attempt to
generate substring locations in a .i file where the underlying .c file
has changed since the .i file was generated.

This can't work, so it seems safest for the on-demand substring
locations to be unavailable for such files, falling back to
"whole string" locations for such cases.

gcc/ChangeLog:
PR preprocessor/78569
* input.c (get_substring_ranges_for_loc): Fail gracefully if
line directives were present.

gcc/testsuite/ChangeLog:
PR preprocessor/78569
* gcc.dg/format/pr78569.c: New test case.

From-SVN: r242990
gcc/ChangeLog
gcc/input.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/format/pr78569.c [new file with mode: 0644]