public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Chung-Lin Tang <cltang@codesourcery.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>
Cc: Nathan Sidwell <nathan@codesourcery.com>
Subject: [PATCH] Propagate -fdiagnostics-* options in lto-wrapper
Date: Sun, 06 Sep 2015 11:42:00 -0000	[thread overview]
Message-ID: <55EC0E15.3080008@codesourcery.com> (raw)

[-- 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:

             reply	other threads:[~2015-09-06  9:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-06 11:42 Chung-Lin Tang [this message]
2015-09-09 21:40 ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55EC0E15.3080008@codesourcery.com \
    --to=cltang@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).