Hi, Dave, Thanks a lot for the review and comments. I just updated the patch with all your suggestions, bootstrapped it and run regression test, no any issue.
The newest patch is attached with this email. Richard/Jakub, please advise on whether I can commit this patch to Gcc10? Thanks a lot. Qing gcc/c-family/ChangeLog: 2020-04-24 qing zhao <qing.z...@oracle.com> * c-indentation.c (get_visual_column): Add a hint to use the new -flarge-source-files option. gcc/ChangeLog: 2020-04-24 qing zhao <qing.z...@oracle.com> * common.opt: Add -flarge-source-files. * doc/invoke.texi: Document it. * toplev.c (process_options): Set line_table->default_range_bits to 0 when flag_large_source_files is true. gcc/testsuite/ChangeLog: 2020-04-24 qing zhao <qing.z...@oracle.com> * gcc.dg/plugin/location-overflow-test-1.c (fn_1): New message to verify that hint about -flarge-source-files is emitted.
PR94230.patch
Description: Binary data
> On Apr 23, 2020, at 5:13 PM, David Malcolm <dmalc...@redhat.com> wrote: > > On Thu, 2020-04-23 at 16:05 -0500, Qing Zhao wrote: > >> Hi, Richard, >> >> This is the 3rd version of the patch, updated based on your previous >> comments. > > Thanks for working on this, and to Richard for the useful comments. > >> Please take a look at it and let me know whether it’s okay to commit? > > I like the overall approach. > > Some nits inline. > > > Maybe: "Verify that hint about -flarge-source-files is emitted". > > >> + if (!flag_large_source_files) >> + inform (loc, >> + "please add %<-flarge-source-files%> to invoke more" >> + " column-tracking for large source files"); > > It's great having a hint here, but I don't love the wording of the > hint. > > Maybe reword to: > > "adding %<-flarge-source-files%> will allow for more column-tracking > support, at the expense of compilation time and memory". > > or somesuch. > >> +This means that diagnostics for later lines do not include column numbers. >> +It also means that options like @option{-Wmisleading-indent} cease to work > ^^^^^^^^^^^^^^^^^^^ > This should be: -Wmisleading-indentation > >> +at that point, although the compiler prints a note if this happens. >> +Passing @option{-flarge-source-files} significantly increases the number >> +of source lines that GCC can process before it stops tracking column. > ^^^^^^ > This should be: columns > >> + if (flag) x = 3; y = 2; /* { dg-message "-:disabled from this point" "add >> '-flarge-source-files'" } */ > > May need updating to match the hint message. > > [...] > > This is OK for stage 1 with those nits fixed. > > There was talk earlier in the thread about fixing this in GCC 10. > > Richi/Jakub: is this OK for stage 4? Although it adds a new command- > line option, it's a workaround for a regression introduced in GCC 6 and > should be low risk. > > Thanks > Dave >