substring locations and # line directives (PR preprocessor/78569)
commita4d96eb77c48caf3db735923ae8c3b589a9dfc06
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Nov 2016 01:13:37 +0000 (30 01:13 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Nov 2016 01:13:37 +0000 (30 01:13 +0000)
tree977d5229cdf9b708bbd2e09cc532aab26e12f656
parent1add78934d928a262350e7eb7b590c816f010ebc
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242990 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/input.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/format/pr78569.c [new file with mode: 0644]