public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Tobias Burnus <tobias@codesourcery.com>
Cc: <gcc-patches@gcc.gnu.org>, Tom de Vries <tdevries@suse.de>,
	Roger Sayle <roger@nextmovesoftware.com>
Subject: Re: [Patch] nvptx: Use fatal_error when -march= is missing not an assert [PR111093]
Date: Wed, 18 Oct 2023 12:16:13 +0200	[thread overview]
Message-ID: <8734y8xmky.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <928b02fd-2662-4a4d-9c55-ab538464b7fb@codesourcery.com>

Hi Tobias!

On 2023-10-16T11:18:45+0200, Tobias Burnus <tobias@codesourcery.com> wrote:
> While mkoffload ensures that there is always a -march=, nvptx's
> cc1 can also be run directly.
>
> In my case, I wanted to know which target-specific #define are
> available; hence, I did run:
>    accel/nvptx-none/cc1 -E -dM < /dev/null
> which gave an ICE. After some debugging, the reasons was
> clear (missing -march=) but somehow a (fatal) error would have been
> nicer than an ICE + debugging.
>
> OK for mainline?

Yes, thanks.  I think I prefer this over hard-coding some default
'ptx_isa_option' -- but may be convinced otherwise (incremental change),
if that's maybe more convenient for others?  (Roger?)


Grüße
 Thomas


> nvptx: Use fatal_error when -march= is missing not an assert [PR111093]
>
> gcc/ChangeLog:
>
>       PR target/111093
>       * config/nvptx/nvptx.cc (nvptx_option_override): Issue fatal error
>       instead of an assert ICE when no -march= has been specified.
>
> diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc
> index edef39fb5e1..634c31673be 100644
> --- a/gcc/config/nvptx/nvptx.cc
> +++ b/gcc/config/nvptx/nvptx.cc
> @@ -335,8 +335,9 @@ nvptx_option_override (void)
>    init_machine_status = nvptx_init_machine_status;
>
>    /* Via nvptx 'OPTION_DEFAULT_SPECS', '-misa' always appears on the command
> -     line.  */
> -  gcc_checking_assert (OPTION_SET_P (ptx_isa_option));
> +     line; but handle the case that the compiler is not run via the driver.  */
> +  if (!OPTION_SET_P (ptx_isa_option))
> +    fatal_error (UNKNOWN_LOCATION, "%<-march=%> must be specified");
>
>    handle_ptx_version_option ();
>
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

  reply	other threads:[~2023-10-18 10:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16  9:18 Tobias Burnus
2023-10-18 10:16 ` Thomas Schwinge [this message]
2023-10-18 16:01   ` Roger Sayle

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=8734y8xmky.fsf@euler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=roger@nextmovesoftware.com \
    --cc=tdevries@suse.de \
    --cc=tobias@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).