* [PATCH] Propagate -fdiagnostics-* options in lto-wrapper
@ 2015-09-06 11:42 Chung-Lin Tang
2015-09-09 21:40 ` Jeff Law
0 siblings, 1 reply; 2+ messages in thread
From: Chung-Lin Tang @ 2015-09-06 11:42 UTC (permalink / raw)
To: gcc-patches; +Cc: Nathan Sidwell
[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]
Hi,
Currently most non-target specific options are skipped when crossing the
LTO/offload processing border, however since there are still quite a
number of warning calls in many target backends, it makes sense to
save and propagate the associated options, to preserve consistency in warning
behavior.
For example, currently:
$ x86_64-pc-linux-gnu-gcc -fopenacc test.c -fno-diagnostics-show-caret
y.c: In function 'main._omp_fn.0':
y.c:6:11: warning: using num_workers (32), ignoring 500
#pragma acc parallel num_workers(500)
^
(note: this warning message is triggered by nvptx code currently only
on gomp-4_0-branch, but illustrates the point)
The caret stills shows, because -fno-diagnostics-show-caret does not
reach the accel compiler. -flto should also have a similar issue.
The attached patch allows a series of -fdiagnostics-* options to be
propagated by lto-wrapper. I've tested this patch without regressions,
is this okay for trunk?
Thanks,
Chung-Lin
2015-09-06 Chung-Lin Tang <cltang@codesourcery.com>
* lto-wrapper.c (merge_and_complain): Add OPT_fdiagnostics_show_caret,
OPT_fdiagnostics_show_option, OPT_fdiagnostics_show_location_, and
OPT_fshow_column to handled saved option cases.
(append_compiler_options): Do not skip the above added options.
[-- Attachment #2: lto-wrapper.patch --]
[-- Type: text/x-patch, Size: 810 bytes --]
Index: lto-wrapper.c
===================================================================
--- lto-wrapper.c (revision 227508)
+++ lto-wrapper.c (working copy)
@@ -232,6 +232,10 @@ merge_and_complain (struct cl_decoded_option **dec
break;
/* Fallthru. */
+ case OPT_fdiagnostics_show_caret:
+ case OPT_fdiagnostics_show_option:
+ case OPT_fdiagnostics_show_location_:
+ case OPT_fshow_column:
case OPT_fPIC:
case OPT_fpic:
case OPT_fPIE:
@@ -479,6 +483,10 @@ append_compiler_options (obstack *argv_obstack, st
on any CL_TARGET flag and a few selected others. */
switch (option->opt_index)
{
+ case OPT_fdiagnostics_show_caret:
+ case OPT_fdiagnostics_show_option:
+ case OPT_fdiagnostics_show_location_:
+ case OPT_fshow_column:
case OPT_fPIC:
case OPT_fpic:
case OPT_fPIE:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Propagate -fdiagnostics-* options in lto-wrapper
2015-09-06 11:42 [PATCH] Propagate -fdiagnostics-* options in lto-wrapper Chung-Lin Tang
@ 2015-09-09 21:40 ` Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2015-09-09 21:40 UTC (permalink / raw)
To: Chung-Lin Tang, gcc-patches; +Cc: Nathan Sidwell
On 09/06/2015 03:57 AM, Chung-Lin Tang wrote:
> Hi,
> Currently most non-target specific options are skipped when crossing the
> LTO/offload processing border, however since there are still quite a
> number of warning calls in many target backends, it makes sense to
> save and propagate the associated options, to preserve consistency in warning
> behavior.
>
> For example, currently:
> $ x86_64-pc-linux-gnu-gcc -fopenacc test.c -fno-diagnostics-show-caret
> y.c: In function 'main._omp_fn.0':
> y.c:6:11: warning: using num_workers (32), ignoring 500
> #pragma acc parallel num_workers(500)
> ^
> (note: this warning message is triggered by nvptx code currently only
> on gomp-4_0-branch, but illustrates the point)
>
> The caret stills shows, because -fno-diagnostics-show-caret does not
> reach the accel compiler. -flto should also have a similar issue.
>
> The attached patch allows a series of -fdiagnostics-* options to be
> propagated by lto-wrapper. I've tested this patch without regressions,
> is this okay for trunk?
>
> Thanks,
> Chung-Lin
>
> 2015-09-06 Chung-Lin Tang <cltang@codesourcery.com>
>
> * lto-wrapper.c (merge_and_complain): Add OPT_fdiagnostics_show_caret,
> OPT_fdiagnostics_show_option, OPT_fdiagnostics_show_location_, and
> OPT_fshow_column to handled saved option cases.
> (append_compiler_options): Do not skip the above added options.
OK. Please install.
Thanks,
Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-09 21:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-06 11:42 [PATCH] Propagate -fdiagnostics-* options in lto-wrapper Chung-Lin Tang
2015-09-09 21:40 ` Jeff Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).