public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Jakub Jelinek <jakub@redhat.com>, Ilya Verbin <iverbin@gmail.com>,
	Richard Biener <richard.guenther@gmail.com>,
	Richard Biener <rguenther@suse.de>, Jan Hubicka <hubicka@ucw.cz>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	Kirill Yukhin <kirill.yukhin@gmail.com>
Subject: Re: Forwarding -foffload=[...] from the driver (compile-time) to libgomp (run-time)
Date: Fri, 14 Aug 2015 21:48:00 -0000	[thread overview]
Message-ID: <87lhddsfs4.fsf@schwinge.name> (raw)
In-Reply-To: <alpine.DEB.2.10.1508141655200.16651@digraph.polyomino.org.uk>

[-- Attachment #1: Type: text/plain, Size: 2312 bytes --]

Hi!

On Fri, 14 Aug 2015 16:56:25 +0000, Joseph Myers <joseph@codesourcery.com> wrote:
> On Fri, 14 Aug 2015, Thomas Schwinge wrote:
> 
> > This function »generate[s] a C source file containing a constructor call
> > to GOMP_set_offload_targets [...], and adds that as an infile«.  This
> > "basically" works ;-) -- but really only for C source code, and for C++
> > and Fortran it fails if there are command-line options used that conflict
> > with the C compilation of add-omp-infile, such as (from a libgomp
> > testsuite run): for C++: -std=c++11, -fno-extern-tls-init, or for
> > Fortran: -fcray-pointer, -fintrinsic-modules-path.  Any suggestion about
> > how to overcome that?

The "problem", as (I hope) I understand it, is that gcc/gcc.c:cc1_options
includes %{std*[...]} and %{f*}, which will match/accept the
C++/Fortran-specific command-line arguments (as cited above) even if
actually operating in C language mode for the add-omp-infile compilation.

> I suppose you need to use the option-handling information about which 
> options are for which languages to filter out any options that aren't 
> valid for C or Common.

OK, that sounds simple enough, conceptually.  So, you are invalidating my
worry that the driver might in fact not be able to do this kind of thing
(mixed language compilation).

I'm currently trying to understand how all that command-line option
parsing code works, and the handoff from the driver to the frontends;
processing of the specs language.

Can you suggest off-hand where you'd expect this option filtering to
happen?  Should this be during specs parsing in the driver; something
like adding a lang_mask to gcc/gcc.c:struct switchstr, and then in
gcc/gcc.c:give_switch ignore any switches that don't match the expected
CL_*?  I seem to have difficulties to properly populate/deduce that
lang_mask at the call sites of gcc/gcc.c:save_switch.  Or, did you
imagine that to be done differently?

Alternatively, what about changing gcc/opts-global.c:complain_wrong_lang
to silently ignore options that don't apply instead of emitting a »is
valid for [...] but not for [...]« diagnostic, if a (new) flag
(-f[something]?) has been set, which would be active only during the
add-omp-infile compilation?


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 472 bytes --]

  reply	other threads:[~2015-08-14 21:48 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-27 18:17 [PATCH 2/n] OpenMP 4.0 offloading infrastructure: LTO streaming Ilya Verbin
2014-09-29  1:10 ` Jan Hubicka
2014-09-29 17:37   ` Ilya Verbin
2014-09-30 11:40     ` Thomas Schwinge
2014-10-01 16:13       ` Ilya Verbin
2014-10-08  8:45         ` Jakub Jelinek
2014-10-08  9:13           ` Jakub Jelinek
2014-10-15 14:28         ` Richard Biener
2014-10-20 11:21           ` Ilya Verbin
2014-10-20 11:26             ` Jakub Jelinek
2014-10-24 14:16             ` Ilya Verbin
2014-10-24 14:29               ` Jakub Jelinek
2014-10-28 19:32                 ` Ilya Verbin
2014-11-03  9:24                   ` Jakub Jelinek
2014-11-05 12:47                     ` Ilya Verbin
2014-11-05 12:50                       ` Jakub Jelinek
2014-11-07 14:41                         ` Kirill Yukhin
2014-11-12  9:32                       ` Richard Biener
2014-11-12 14:11                         ` Kirill Yukhin
2014-11-12 14:23                           ` Richard Biener
2014-11-12 14:35                             ` Kirill Yukhin
2014-11-12 14:41                               ` Richard Biener
2014-11-12 17:38                                 ` Ilya Verbin
2014-11-13  8:51                                   ` Richard Biener
2015-07-31 15:37                       ` Thomas Schwinge
2015-07-31 15:43                         ` Ilya Verbin
2015-08-05  8:40                           ` Richard Biener
2015-08-05 15:09                             ` Ilya Verbin
2015-08-14  9:49                               ` Forwarding -foffload=[...] from the driver (compile-time) to libgomp (run-time) (was: [PATCH 2/n] OpenMP 4.0 offloading infrastructure: LTO streaming) Thomas Schwinge
2015-08-14 13:29                                 ` Ilya Verbin
2015-08-17 13:57                                   ` Martin Jambor
2015-08-14 17:08                                 ` Joseph Myers
2015-08-14 21:48                                   ` Thomas Schwinge [this message]
2015-08-15  4:03                                     ` Forwarding -foffload=[...] from the driver (compile-time) to libgomp (run-time) Joseph Myers
2015-08-18 16:55                                       ` Thomas Schwinge
2015-08-20 23:38                                         ` Joseph Myers
2015-08-21 16:13                                           ` Nathan Sidwell
2015-08-21 16:21                                             ` Joseph Myers
2015-08-24 18:05                                               ` Joseph Myers
2015-08-24 22:50                                                 ` Joseph Myers
2015-08-24 23:26                                                   ` Nathan Sidwell
2015-08-25 15:04                                           ` Joseph Myers
2018-05-20 20:30                                           ` [og7] " Thomas Schwinge
2015-08-27 20:58 Pass -foffload targets from driver to libgomp at link time Joseph Myers
2015-09-03 14:58 ` Ping " Joseph Myers
2015-09-10 14:01   ` Ping^2 " Joseph Myers
2015-09-10 14:03     ` Bernd Schmidt
2015-09-11 14:29       ` Joseph Myers
2015-09-11 14:48         ` Bernd Schmidt
2015-09-11 15:28           ` Joseph Myers
2015-09-11 15:47             ` Jakub Jelinek
2015-09-11 16:16               ` Joseph Myers
2015-09-28 10:09               ` Thomas Schwinge
2015-09-29  9:48                 ` Jakub Jelinek
2015-09-30 16:15                   ` Thomas Schwinge
2015-10-19 16:56                     ` Forwarding -foffload=[...] from the driver (compile-time) to libgomp (run-time) Thomas Schwinge
2015-10-20 10:03                       ` Jakub Jelinek
2015-10-20 10:44                         ` Bernd Schmidt
2015-10-20 11:18                         ` Thomas Schwinge
2015-10-20 11:49                           ` Bernd Schmidt
2015-10-20 12:13                             ` Jakub Jelinek
2015-10-20 11:52                           ` Jakub Jelinek

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=87lhddsfs4.fsf@schwinge.name \
    --to=thomas@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=iverbin@gmail.com \
    --cc=jakub@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=kirill.yukhin@gmail.com \
    --cc=rguenther@suse.de \
    --cc=richard.guenther@gmail.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).