https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89099
Bug ID: 89099 Summary: Have "-fopt-info" show the original source code context Product: gcc Version: 9.0 Status: UNCONFIRMED Keywords: diagnostic Severity: enhancement Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: tschwinge at gcc dot gnu.org Target Milestone: --- It would be useful to have "-fopt-info" show the original source code context. For example, we've got diagnostics like: [...]/asyncwait-1.c: In function 'main': [...]/asyncwait-1.c:14:11: warning: unused parameter 'argc' [-Wunused-parameter] 14 | main (int argc, char **argv) | ~~~~^~~~ ..., but "-fopt-info" only prints a terse form: [...] [...]/asyncwait-1.c:480:9: optimized: assigned OpenACC gang loop parallelism [...] ... without showing any of the original source code context. This should be enabled by default, if possible, but disabled by some flag (can just use "-fno-diagnostics-show-caret" here, too?).