public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* nvptx multilib setup (was: [Bug target/104364] [12 Regression] OpenMP/nvptx regressions after "[nvptx] Add some support for .local atomics")
       [not found] ` <bug-104364-4-ILKfZXTaRC@http.gcc.gnu.org/bugzilla/>
@ 2022-02-04  7:21   ` Thomas Schwinge
  2022-02-04 12:09     ` Tom de Vries
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Schwinge @ 2022-02-04  7:21 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gcc

Hi Tom!

Taking this one to the mailing list; not directly related to PR104364:

On 2022-02-03T13:35:55+0000, "vries at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org> wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104364

> I've tested this using (recommended) driver 470.94 on boards:

(As not every user will be using the recommended/latest, I too am doing
some testing also on oldish Nvidia/CUDA Driver versions.)  Combinatorial
explosion is a problem, of course...

> while iterating over dimensions { -mptx=3.1 , -mptx=6.3 } x { GOMP_NVPTX_JIT=-O0, <default> }.

Do you use separate (nvptx-none offload target only?) builds for
different '-mptx' variants (likewise: '-misa'), or have you hacked up the
multilib configuration?  ('gcc/config/nvptx/t-nvptx:MULTILIB_OPTIONS'
etc., I suppose?)  Should we add a few representative configurations to
be built by default?  And/or, should we have a way to 'configure' per
user needs (I suppose: '--with-multilib-list=[...]', as supported for a
few other targets?)?  (I see there's also a new
'--with-multilib-generator=[...]', haven't looked in detail.)  No matter
which way: again, combinatorial explosion is a problem, of course...

For example, in addition to the default (fiji/gfx803) for GCN we've got:

    gcc/config/gcn/t-gcn-hsa:MULTILIB_OPTIONS = march=gfx900/march=gfx906/march=gfx908
    gcc/config/gcn/t-gcn-hsa:MULTILIB_DIRNAMES = gfx900 gfx906 gfx908


Grüße
 Thomas
-----------------
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: nvptx multilib setup (was: [Bug target/104364] [12 Regression] OpenMP/nvptx regressions after "[nvptx] Add some support for .local atomics")
  2022-02-04  7:21   ` nvptx multilib setup (was: [Bug target/104364] [12 Regression] OpenMP/nvptx regressions after "[nvptx] Add some support for .local atomics") Thomas Schwinge
@ 2022-02-04 12:09     ` Tom de Vries
  2022-05-13 14:20       ` nvptx multilib setup Thomas Schwinge
  2022-09-28 13:50       ` DejaGnu: flags via 'RUNTESTFLAGS' overriding those specified in test cases Thomas Schwinge
  0 siblings, 2 replies; 7+ messages in thread
From: Tom de Vries @ 2022-02-04 12:09 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: gcc

On 2/4/22 08:21, Thomas Schwinge wrote:
> Hi Tom!
> 
> Taking this one to the mailing list; not directly related to PR104364:
> 
> On 2022-02-03T13:35:55+0000, "vries at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org> wrote:
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104364
> 
>> I've tested this using (recommended) driver 470.94 on boards:
> 
> (As not every user will be using the recommended/latest, I too am doing
> some testing also on oldish Nvidia/CUDA Driver versions.)  Combinatorial
> explosion is a problem, of course...
> 

I am starting to suspect that I misinterpreted the nvidia website.  When 
asking for a driver for a board, I get some driver, which I took to be 
the recommended one.

But I started to notice changes in recommended version from 470.x to 
510.x, which suggest the recommended one is just the latest one they've 
updated in the set of recommended drivers.  So it seems inaccurate to 
talk about "the" recommended driver.

Thanks for the testing, much appreciated. I'm currently testing with 390.x.

>> while iterating over dimensions { -mptx=3.1 , -mptx=6.3 } x { GOMP_NVPTX_JIT=-O0, <default> }.
> 
> Do you use separate (nvptx-none offload target only?) builds for
> different '-mptx' variants (likewise: '-misa'), or have you hacked up the
> multilib configuration? 

Neither, I'm using --target_board=unix/foffload= for that.

  ('gcc/config/nvptx/t-nvptx:MULTILIB_OPTIONS'
> etc., I suppose?)  Should we add a few representative configurations to
> be built by default?  And/or, should we have a way to 'configure' per
> user needs (I suppose: '--with-multilib-list=[...]', as supported for a
> few other targets?)?  (I see there's also a new
> '--with-multilib-generator=[...]', haven't looked in detail.)  No matter
> which way: again, combinatorial explosion is a problem, of course...
> 

As far as I know, the gcc build doesn't finish when switching default to 
higher than sm_35, so there's little point to go to a multilib setup at 
this point.  But once we fix that, we could reconsider, otherwise, 
things are likely to regress again.

Thanks,
- Tom


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: nvptx multilib setup
  2022-02-04 12:09     ` Tom de Vries
@ 2022-05-13 14:20       ` Thomas Schwinge
  2022-09-28 13:50       ` DejaGnu: flags via 'RUNTESTFLAGS' overriding those specified in test cases Thomas Schwinge
  1 sibling, 0 replies; 7+ messages in thread
From: Thomas Schwinge @ 2022-05-13 14:20 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gcc

Hi Tom!

On 2022-02-04T13:09:29+0100, Tom de Vries via Gcc <gcc@gcc.gnu.org> wrote:
> On 2/4/22 08:21, Thomas Schwinge wrote:
>> On 2022-02-03T13:35:55+0000, "vries at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org> wrote:
>>> I've tested this using (recommended) driver 470.94 on boards:

>>> while iterating over dimensions { -mptx=3.1 , -mptx=6.3 } x { GOMP_NVPTX_JIT=-O0, <default> }.
>>
>> Do you use separate (nvptx-none offload target only?) builds for
>> different '-mptx' variants (likewise: '-misa'), or have you hacked up the
>> multilib configuration?
>
> Neither, I'm using --target_board=unix/foffload= for that.

ACK, I see.  So these flags then only affect GCC/nvptx code generation
for the actual user code (here: GCC libgomp test cases), but for the
GCC/nvptx target libraries (such as: libc, libm, libgfortran, libgomp --
the latter especially relevant for OpenMP), it uses PTX code from one of
the two "pre-compiled" GCC/nvptx multilibs: default or '-mptx=3.1'.

Meaning, one can't just use such a flag for "completely building code"
for a specific configuration.  Random example,
'-foffload-options=nvptx-none=-march=sm_75': as GCC/nvptx target
libraries aren't being built for '-march=sm_75' multilib,
'-foffload-options=nvptx-none=-march=sm_75' uses the default multilib,
which isn't '-march=sm_75'.


>   ('gcc/config/nvptx/t-nvptx:MULTILIB_OPTIONS'
>> etc., I suppose?)  Should we add a few representative configurations to
>> be built by default?  And/or, should we have a way to 'configure' per
>> user needs (I suppose: '--with-multilib-list=[...]', as supported for a
>> few other targets?)?  (I see there's also a new
>> '--with-multilib-generator=[...]', haven't looked in detail.)  No matter
>> which way: again, combinatorial explosion is a problem, of course...
>
> As far as I know, the gcc build doesn't finish when switching default to
> higher than sm_35, so there's little point to go to a multilib setup at
> this point.  But once we fix that, we could reconsider, otherwise,
> things are likely to regress again.

As far as I remember, several issues have been fixed.  Still waiting for
Roger's "middle-end: Support ABIs that pass FP values as wider integers"
or something similar, but that PR104489 issue is being worked around by
"Limit HFmode support to mexperimental", if I got that right.

Now I'm not suggesting we should now enable all or any random GCC/nvptx
multilibs, to get all these variants of GCC/nvptx target libraries built;
especially also given that GCC/nvptx code generation currently doesn't
make too much use of the new capabilities.

However, we do have a specific request that a customer would like to be
able to change at GCC 'configure' time the GCC/nvptx default multilib
(including that being used for building corresponding GCC/nvptx target
libraries).

Per 'gcc/doc/install.texi', I do see that some GCC targets allow for
GCC 'configure'-time '--with-multilib-list=[...]', or
'--with-multilib-generator=[...]', and I suppose we could be doing
something similar?  But before starting implementing, I'd like your
input, as you'll be the one to approve in the end.  And/or, maybe you've
already made up your own ideas about that?


Grüße
 Thomas
-----------------
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* DejaGnu: flags via 'RUNTESTFLAGS' overriding those specified in test cases
  2022-02-04 12:09     ` Tom de Vries
  2022-05-13 14:20       ` nvptx multilib setup Thomas Schwinge
@ 2022-09-28 13:50       ` Thomas Schwinge
  2022-09-28 14:12         ` Jonathan Wakely
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Schwinge @ 2022-09-28 13:50 UTC (permalink / raw)
  To: Tom de Vries, gcc; +Cc: Segher Boessenkool, Peter Bergner, Kewen Lin

Hi!

On 2022-02-04T13:09:29+0100, Tom de Vries via Gcc <gcc@gcc.gnu.org> wrote:
> On 2/4/22 08:21, Thomas Schwinge wrote:
>> On 2022-02-03T13:35:55+0000, "vries at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org> wrote:
>>> while iterating over dimensions { -mptx=3.1 , -mptx=6.3 } x { GOMP_NVPTX_JIT=-O0, <default> }.
>>
>> Do you use separate (nvptx-none offload target only?) builds for
>> different '-mptx' variants (likewise: '-misa'), or have you hacked up the
>> multilib configuration?
>
> Neither, I'm using --target_board=unix/foffload= for that.

OK, so that's for libgomp nvptx offloading testing.

What about nvptx target testing:
'gcc/testsuite/gcc.target/nvptx/nvptx.exp'.

We have a DejaGnu board file, say 'BOARD', invoking the nvptx-tools
'nvptx-none-run' launcher
(<https://github.com/MentorEmbedded/nvptx-tools/>):

    $ make check RUNTESTFLAGS='--target_board=BOARD'

That generally works as expected.

But now suppose that 'BOARD' needs '-mptx=3.1', because old CUDA, for
example.  Running the obvious '--target_board=BOARD/-mptx=3.1' FAILs in a
number of 'gcc.target/nvptx/nvptx.exp' test cases, for example:

    FAIL: gcc.target/nvptx/alias-1.c (test for excess errors)
    Excess errors:
    [...]/gcc.target/nvptx/alias-1.c:13:6: error: alias definitions not supported in this configuration

That's because we then invoke GCC as follows:

    [GCC] [...]/gcc.target/nvptx/alias-1.c [...] -malias -mptx=6.3 [...] -mptx=3.1 -o ./alias-1.exe

Here, '-malias -mptx=6.3' are due to 'dg-add-options ptx_alias' in the
test case, but our '-mptx=3.1' overrides that, thus FAIL.  I think these
would work if the '-mptx=3.1' came first?

Do we need something like this:

    gcc/config/rs6000/rs6000.h:/* Only for use in the testsuite: -mdejagnu-cpu=<value> filters out all
    gcc/config/rs6000/rs6000.h-   -mcpu= as well as -mtune= options then simply adds -mcpu=<value>,
    gcc/config/rs6000/rs6000.h:   while -mdejagnu-tune=<value> filters out all -mtune= options then
    gcc/config/rs6000/rs6000.h-   simply adds -mtune=<value>.
    gcc/config/rs6000/rs6000.h-   With older versions of Dejagnu the command line arguments you set in
    gcc/config/rs6000/rs6000.h-   RUNTESTFLAGS override those set in the testcases; with these options,
    gcc/config/rs6000/rs6000.h-   the testcase will always win.  */
    gcc/config/rs6000/rs6000.h-#define DRIVER_SELF_SPECS \
    gcc/config/rs6000/rs6000.h:  "%{mdejagnu-cpu=*: %<mcpu=* %<mtune=* -mcpu=%*}", \
    gcc/config/rs6000/rs6000.h:  "%{mdejagnu-tune=*: %<mtune=* -mtune=%*}", \
    gcc/config/rs6000/rs6000.h:  "%{mdejagnu-*: %<mdejagnu-*}", \
    gcc/config/rs6000/rs6000.h-   SUBTARGET_DRIVER_SELF_SPECS

History:

  - commit 75e2b35dd0456a148805eae3e7c0e55c6336c263 "rs6000: Add -mdejagnu-cpu="
  - commit 98ae96d2ade339df1a2d3a46e6a7faa60aece139 "re PR target/91050 (-mdejagnu-cpu=<cpu> does not affect the -m<cpu> assembler option)"
  - commit 75d20d6c84c12bedd65a904e462f02f0b9eb3f77 "rs6000: Adjust -mdejagnu-cpu to filter out -mtune [PR106345]"

(For example, we'd then use '-mdejagnu-ptx=[...]' in the test case (here, via
'dg-add-options ptx_alias'), overriding the '-mptx=3.1' of 'RUNTESTFLAGS'.)


Grüße
 Thomas
-----------------
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DejaGnu: flags via 'RUNTESTFLAGS' overriding those specified in test cases
  2022-09-28 13:50       ` DejaGnu: flags via 'RUNTESTFLAGS' overriding those specified in test cases Thomas Schwinge
@ 2022-09-28 14:12         ` Jonathan Wakely
  2022-09-28 15:39           ` Segher Boessenkool
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Wakely @ 2022-09-28 14:12 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: Tom de Vries, gcc, Segher Boessenkool

On Wed, 28 Sept 2022 at 14:50, Thomas Schwinge <thomas@codesourcery.com> wrote:
>
> Hi!
>
> On 2022-02-04T13:09:29+0100, Tom de Vries via Gcc <gcc@gcc.gnu.org> wrote:
> > On 2/4/22 08:21, Thomas Schwinge wrote:
> >> On 2022-02-03T13:35:55+0000, "vries at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org> wrote:
> >>> while iterating over dimensions { -mptx=3.1 , -mptx=6.3 } x { GOMP_NVPTX_JIT=-O0, <default> }.
> >>
> >> Do you use separate (nvptx-none offload target only?) builds for
> >> different '-mptx' variants (likewise: '-misa'), or have you hacked up the
> >> multilib configuration?
> >
> > Neither, I'm using --target_board=unix/foffload= for that.
>
> OK, so that's for libgomp nvptx offloading testing.
>
> What about nvptx target testing:
> 'gcc/testsuite/gcc.target/nvptx/nvptx.exp'.
>
> We have a DejaGnu board file, say 'BOARD', invoking the nvptx-tools
> 'nvptx-none-run' launcher
> (<https://github.com/MentorEmbedded/nvptx-tools/>):
>
>     $ make check RUNTESTFLAGS='--target_board=BOARD'
>
> That generally works as expected.
>
> But now suppose that 'BOARD' needs '-mptx=3.1', because old CUDA, for
> example.  Running the obvious '--target_board=BOARD/-mptx=3.1' FAILs in a
> number of 'gcc.target/nvptx/nvptx.exp' test cases, for example:
>
>     FAIL: gcc.target/nvptx/alias-1.c (test for excess errors)
>     Excess errors:
>     [...]/gcc.target/nvptx/alias-1.c:13:6: error: alias definitions not supported in this configuration
>
> That's because we then invoke GCC as follows:
>
>     [GCC] [...]/gcc.target/nvptx/alias-1.c [...] -malias -mptx=6.3 [...] -mptx=3.1 -o ./alias-1.exe
>
> Here, '-malias -mptx=6.3' are due to 'dg-add-options ptx_alias' in the
> test case, but our '-mptx=3.1' overrides that, thus FAIL.  I think these
> would work if the '-mptx=3.1' came first?

Which version of Dejagnu are you using? There was a fix in 6.1 or 6.2
to change the order that the RUNTESTFLAGS and dg-options get added to
the command line.

It's a pain to make the testsuite work consistently for both old and
new versions. I would be very happy if we just said you need a modern
version of Dejagnu, and relied on the semantics in the newer versions.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DejaGnu: flags via 'RUNTESTFLAGS' overriding those specified in test cases
  2022-09-28 14:12         ` Jonathan Wakely
@ 2022-09-28 15:39           ` Segher Boessenkool
  2022-09-29  8:18             ` Thomas Schwinge
  0 siblings, 1 reply; 7+ messages in thread
From: Segher Boessenkool @ 2022-09-28 15:39 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Thomas Schwinge, Tom de Vries, gcc

On Wed, Sep 28, 2022 at 03:12:23PM +0100, Jonathan Wakely wrote:
> Which version of Dejagnu are you using? There was a fix in 6.1 or 6.2
> to change the order that the RUNTESTFLAGS and dg-options get added to
> the command line.
> 
> It's a pain to make the testsuite work consistently for both old and
> new versions. I would be very happy if we just said you need a modern
> version of Dejagnu, and relied on the semantics in the newer versions.

Unfortunately there quite often are bugs in newer versions of DejaGnu
as well, making it impossible to require very new versions of it.


Segher

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DejaGnu: flags via 'RUNTESTFLAGS' overriding those specified in test cases
  2022-09-28 15:39           ` Segher Boessenkool
@ 2022-09-29  8:18             ` Thomas Schwinge
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Schwinge @ 2022-09-29  8:18 UTC (permalink / raw)
  To: Segher Boessenkool, Jonathan Wakely; +Cc: Tom de Vries, gcc

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

Hi!

On 2022-09-28T10:39:59-0500, Segher Boessenkool <segher@kernel.crashing.org> wrote:
> On Wed, Sep 28, 2022 at 03:12:23PM +0100, Jonathan Wakely wrote:
>> Which version of Dejagnu are you using? There was a fix in 6.1 or 6.2

(1.6.1, 1.6.2.)

>> to change the order that the RUNTESTFLAGS and dg-options get added to
>> the command line.

Ah, right,
<http://git.savannah.gnu.org/gitweb/?p=dejagnu.git;a=commit;h=5256bd82343000c76bc0e48139003f90b6184347>...

However, that was not the problem here -- I'd been using such a DejaGnu
version.  That was strange, so I dug deeper, and found: in our *local*
DejaGnu board files a '[...]_target_compile' proc that likewise did need
to be fixed...  :-| With that done, the problem is then gone.

(I'm anyways attaching my "[WIP] nvptx: '-mdejagnu-ptx'", in case that's
ever useful for anyone, but not proposing to push that one.)

>> It's a pain to make the testsuite work consistently for both old and
>> new versions. I would be very happy if we just said you need a modern
>> version of Dejagnu, and relied on the semantics in the newer versions.
>
> Unfortunately there quite often are bugs in newer versions of DejaGnu
> as well, making it impossible to require very new versions of it.

The "require a more recent version of DejaGnu" discussion never gets old,
eh...  ;-P


Grüße
 Thomas


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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-WIP-nvptx-mdejagnu-ptx.patch --]
[-- Type: text/x-diff, Size: 17231 bytes --]

From 3ce58c891359cd439518786448fd21a94c5a70a4 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Wed, 28 Sep 2022 22:14:55 +0200
Subject: [PATCH] [WIP] nvptx: '-mdejagnu-ptx'

Similar to 'gcc/config/rs6000/rs6000.h:DRIVER_SELF_SPECS'.
---
 gcc/config/nvptx/nvptx.h                             | 9 +++++++++
 gcc/testsuite/gcc.target/nvptx/atomic-store-1.c      | 2 +-
 gcc/testsuite/gcc.target/nvptx/atomic-store-2.c      | 2 +-
 gcc/testsuite/gcc.target/nvptx/float16-1.c           | 2 +-
 gcc/testsuite/gcc.target/nvptx/float16-2.c           | 2 +-
 gcc/testsuite/gcc.target/nvptx/float16-3.c           | 2 +-
 gcc/testsuite/gcc.target/nvptx/float16-4.c           | 2 +-
 gcc/testsuite/gcc.target/nvptx/float16-5.c           | 2 +-
 gcc/testsuite/gcc.target/nvptx/float16-6.c           | 2 +-
 gcc/testsuite/gcc.target/nvptx/nvptx.exp             | 4 ++--
 gcc/testsuite/gcc.target/nvptx/ptx31.c               | 2 +-
 gcc/testsuite/gcc.target/nvptx/ptx60.c               | 2 +-
 gcc/testsuite/gcc.target/nvptx/ptx63.c               | 2 +-
 gcc/testsuite/gcc.target/nvptx/ptx70.c               | 2 +-
 gcc/testsuite/gcc.target/nvptx/sm53.c                | 2 +-
 gcc/testsuite/gcc.target/nvptx/sm70.c                | 2 +-
 gcc/testsuite/gcc.target/nvptx/sm75.c                | 2 +-
 gcc/testsuite/gcc.target/nvptx/sm80.c                | 2 +-
 gcc/testsuite/gcc.target/nvptx/tanh-1.c              | 2 +-
 gcc/testsuite/gcc.target/nvptx/uniform-simt-1.c      | 2 +-
 gcc/testsuite/gcc.target/nvptx/uniform-simt-2.c      | 2 +-
 gcc/testsuite/gcc.target/nvptx/uniform-simt-3.c      | 2 +-
 gcc/testsuite/gcc.target/nvptx/uniform-simt-4.c      | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-3-sm35.c | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-3-sm53.c | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-3-sm70.c | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-3-sm75.c | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-3-sm80.c | 2 +-
 libgomp/testsuite/libgomp.c/reverse-offload-sm30.c   | 2 +-
 30 files changed, 39 insertions(+), 30 deletions(-)

diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
index 0afc83b10a3..b015182a7d8 100644
--- a/gcc/config/nvptx/nvptx.h
+++ b/gcc/config/nvptx/nvptx.h
@@ -27,6 +27,15 @@
 
 /* Run-time Target.  */
 
+/* Only for use in the testsuite: -mdejagnu-ptx=<value> filters out all
+   -mptx= options then simply adds -mptx=<value>.
+   With older versions of Dejagnu the command line arguments you set in
+   RUNTESTFLAGS override those set in the testcases; with these options,
+   the testcase will always win.  */
+#define DRIVER_SELF_SPECS \
+  "%{mdejagnu-ptx=*: %<mptx=* -mptx=%*}", \
+  "%{mdejagnu-*: %<mdejagnu-*}"
+
 /* Use '--with-arch' for default '-misa'.  */
 #define OPTION_DEFAULT_SPECS \
   { "arch", "%{!misa=*:-misa=%(VALUE)}" }, \
diff --git a/gcc/testsuite/gcc.target/nvptx/atomic-store-1.c b/gcc/testsuite/gcc.target/nvptx/atomic-store-1.c
index eecd00854f7..a81f96acc08 100644
--- a/gcc/testsuite/gcc.target/nvptx/atomic-store-1.c
+++ b/gcc/testsuite/gcc.target/nvptx/atomic-store-1.c
@@ -2,7 +2,7 @@
    shared state space.  */
 
 /* { dg-do compile } */
-/* { dg-options "-misa=sm_53 -mptx=_" } */
+/* { dg-options "-misa=sm_53 -mdejagnu-ptx=_" } */
 
 enum memmodel
 {
diff --git a/gcc/testsuite/gcc.target/nvptx/atomic-store-2.c b/gcc/testsuite/gcc.target/nvptx/atomic-store-2.c
index 127d2c4cbe2..d5f89256857 100644
--- a/gcc/testsuite/gcc.target/nvptx/atomic-store-2.c
+++ b/gcc/testsuite/gcc.target/nvptx/atomic-store-2.c
@@ -2,7 +2,7 @@
    shared state space.  */
 
 /* { dg-do compile } */
-/* { dg-options "-misa=sm_70 -mptx=_" } */
+/* { dg-options "-misa=sm_70 -mdejagnu-ptx=_" } */
 
 enum memmodel
 {
diff --git a/gcc/testsuite/gcc.target/nvptx/float16-1.c b/gcc/testsuite/gcc.target/nvptx/float16-1.c
index 017774c2941..d59dcc264a9 100644
--- a/gcc/testsuite/gcc.target/nvptx/float16-1.c
+++ b/gcc/testsuite/gcc.target/nvptx/float16-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ffast-math -misa=sm_53 -mptx=_" } */
+/* { dg-options "-O2 -ffast-math -misa=sm_53 -mdejagnu-ptx=_" } */
 /* { dg-additional-options "-mexperimental" } */
 
 _Float16 var;
diff --git a/gcc/testsuite/gcc.target/nvptx/float16-2.c b/gcc/testsuite/gcc.target/nvptx/float16-2.c
index e15b685253b..46a6895b703 100644
--- a/gcc/testsuite/gcc.target/nvptx/float16-2.c
+++ b/gcc/testsuite/gcc.target/nvptx/float16-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ffast-math -misa=sm_80 -mptx=_" } */
+/* { dg-options "-O2 -ffast-math -misa=sm_80 -mdejagnu-ptx=_" } */
 /* { dg-additional-options "-mexperimental" } */
 
 _Float16 x;
diff --git a/gcc/testsuite/gcc.target/nvptx/float16-3.c b/gcc/testsuite/gcc.target/nvptx/float16-3.c
index 1c646902055..c4ca7dff3d7 100644
--- a/gcc/testsuite/gcc.target/nvptx/float16-3.c
+++ b/gcc/testsuite/gcc.target/nvptx/float16-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -misa=sm_53 -mptx=_" } */
+/* { dg-options "-O2 -misa=sm_53 -mdejagnu-ptx=_" } */
 /* { dg-additional-options "-mexperimental" } */
 
 _Float16 var;
diff --git a/gcc/testsuite/gcc.target/nvptx/float16-4.c b/gcc/testsuite/gcc.target/nvptx/float16-4.c
index 1c24ec8c3b2..09687aab63b 100644
--- a/gcc/testsuite/gcc.target/nvptx/float16-4.c
+++ b/gcc/testsuite/gcc.target/nvptx/float16-4.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ffast-math -misa=sm_53 -mptx=_" } */
+/* { dg-options "-O2 -ffast-math -misa=sm_53 -mdejagnu-ptx=_" } */
 /* { dg-additional-options "-mexperimental" } */
 
 _Float16 var;
diff --git a/gcc/testsuite/gcc.target/nvptx/float16-5.c b/gcc/testsuite/gcc.target/nvptx/float16-5.c
index 9ae3365e1a6..f3960f9634c 100644
--- a/gcc/testsuite/gcc.target/nvptx/float16-5.c
+++ b/gcc/testsuite/gcc.target/nvptx/float16-5.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ffast-math -misa=sm_53 -mptx=_" } */
+/* { dg-options "-O2 -ffast-math -misa=sm_53 -mdejagnu-ptx=_" } */
 /* { dg-additional-options "-mexperimental" } */
 
 _Float16 a;
diff --git a/gcc/testsuite/gcc.target/nvptx/float16-6.c b/gcc/testsuite/gcc.target/nvptx/float16-6.c
index 37c580429c5..452dc501ada 100644
--- a/gcc/testsuite/gcc.target/nvptx/float16-6.c
+++ b/gcc/testsuite/gcc.target/nvptx/float16-6.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -misa=sm_53 -mptx=_" } */
+/* { dg-options "-O2 -misa=sm_53 -mdejagnu-ptx=_" } */
 /* { dg-additional-options "-mexperimental" } */
 
 _Float16 x;
diff --git a/gcc/testsuite/gcc.target/nvptx/nvptx.exp b/gcc/testsuite/gcc.target/nvptx/nvptx.exp
index e9622ae7aaa..15a8a8b1000 100644
--- a/gcc/testsuite/gcc.target/nvptx/nvptx.exp
+++ b/gcc/testsuite/gcc.target/nvptx/nvptx.exp
@@ -60,7 +60,7 @@ proc check_effective_target_runtime_ptx_isa_version_at_least { major minor } {
     if { $default } {
 	set flag ""
     } else {
-	set flag "-mptx=$major.$minor"
+	set flag "-mdejagnu-ptx=$major.$minor"
     }
 
     set res [check_runtime $name {
@@ -80,7 +80,7 @@ proc add_options_for_ptx_alias { flags } {
     append flags " -malias"
 
     if { ![check_effective_target_default_ptx_isa_version_at_least 6 3] } {
-	append flags " -mptx=6.3"
+	append flags " -mdejagnu-ptx=6.3"
     }
 
     return $flags
diff --git a/gcc/testsuite/gcc.target/nvptx/ptx31.c b/gcc/testsuite/gcc.target/nvptx/ptx31.c
index 46b5e1ba405..89ec9adfd34 100644
--- a/gcc/testsuite/gcc.target/nvptx/ptx31.c
+++ b/gcc/testsuite/gcc.target/nvptx/ptx31.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-march=sm_30 -mptx=3.1" } */
+/* { dg-options "-march=sm_30 -mdejagnu-ptx=3.1" } */
 
 #if __PTX_ISA_VERSION_MAJOR__ != 3
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
diff --git a/gcc/testsuite/gcc.target/nvptx/ptx60.c b/gcc/testsuite/gcc.target/nvptx/ptx60.c
index 267a9c64f1e..17fd935b676 100644
--- a/gcc/testsuite/gcc.target/nvptx/ptx60.c
+++ b/gcc/testsuite/gcc.target/nvptx/ptx60.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-march=sm_30 -mptx=6.0" } */
+/* { dg-options "-march=sm_30 -mdejagnu-ptx=6.0" } */
 
 #if __PTX_ISA_VERSION_MAJOR__ != 6
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
diff --git a/gcc/testsuite/gcc.target/nvptx/ptx63.c b/gcc/testsuite/gcc.target/nvptx/ptx63.c
index 13d02e132ae..af55b3c5c08 100644
--- a/gcc/testsuite/gcc.target/nvptx/ptx63.c
+++ b/gcc/testsuite/gcc.target/nvptx/ptx63.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-march=sm_30 -mptx=6.3" } */
+/* { dg-options "-march=sm_30 -mdejagnu-ptx=6.3" } */
 
 #if __PTX_ISA_VERSION_MAJOR__ != 6
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
diff --git a/gcc/testsuite/gcc.target/nvptx/ptx70.c b/gcc/testsuite/gcc.target/nvptx/ptx70.c
index 15df13604bd..61bcc6bc92a 100644
--- a/gcc/testsuite/gcc.target/nvptx/ptx70.c
+++ b/gcc/testsuite/gcc.target/nvptx/ptx70.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-march=sm_30 -mptx=7.0" } */
+/* { dg-options "-march=sm_30 -mdejagnu-ptx=7.0" } */
 
 #if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
diff --git a/gcc/testsuite/gcc.target/nvptx/sm53.c b/gcc/testsuite/gcc.target/nvptx/sm53.c
index b4d819c6a79..bd24880bcae 100644
--- a/gcc/testsuite/gcc.target/nvptx/sm53.c
+++ b/gcc/testsuite/gcc.target/nvptx/sm53.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-misa=sm_53 -mptx=_" } */
+/* { dg-options "-misa=sm_53 -mdejagnu-ptx=_" } */
 
 #if __PTX_SM__ != 530
 #error wrong value for __PTX_SM__
diff --git a/gcc/testsuite/gcc.target/nvptx/sm70.c b/gcc/testsuite/gcc.target/nvptx/sm70.c
index 4bd012b5680..50d7eacdc48 100644
--- a/gcc/testsuite/gcc.target/nvptx/sm70.c
+++ b/gcc/testsuite/gcc.target/nvptx/sm70.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-misa=sm_70 -mptx=_" } */
+/* { dg-options "-misa=sm_70 -mdejagnu-ptx=_" } */
 
 #if __PTX_SM__ != 700
 #error wrong value for __PTX_SM__
diff --git a/gcc/testsuite/gcc.target/nvptx/sm75.c b/gcc/testsuite/gcc.target/nvptx/sm75.c
index d159d3f5fb3..38b06430666 100644
--- a/gcc/testsuite/gcc.target/nvptx/sm75.c
+++ b/gcc/testsuite/gcc.target/nvptx/sm75.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-misa=sm_75 -mptx=_" } */
+/* { dg-options "-misa=sm_75 -mdejagnu-ptx=_" } */
 
 #if __PTX_SM__ != 750
 #error wrong value for __PTX_SM__
diff --git a/gcc/testsuite/gcc.target/nvptx/sm80.c b/gcc/testsuite/gcc.target/nvptx/sm80.c
index ef6d8b7fa23..1e3df05afc0 100644
--- a/gcc/testsuite/gcc.target/nvptx/sm80.c
+++ b/gcc/testsuite/gcc.target/nvptx/sm80.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-misa=sm_80 -mptx=_" } */
+/* { dg-options "-misa=sm_80 -mdejagnu-ptx=_" } */
 
 #if __PTX_SM__ != 800
 #error wrong value for __PTX_SM__
diff --git a/gcc/testsuite/gcc.target/nvptx/tanh-1.c b/gcc/testsuite/gcc.target/nvptx/tanh-1.c
index 534846cd62d..ff4c6d1b008 100644
--- a/gcc/testsuite/gcc.target/nvptx/tanh-1.c
+++ b/gcc/testsuite/gcc.target/nvptx/tanh-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ffast-math -misa=sm_75 -mptx=_" } */
+/* { dg-options "-O2 -ffast-math -misa=sm_75 -mdejagnu-ptx=_" } */
 
 float foo(float x)
 {
diff --git a/gcc/testsuite/gcc.target/nvptx/uniform-simt-1.c b/gcc/testsuite/gcc.target/nvptx/uniform-simt-1.c
index fc225764e6b..c47f3d0262d 100644
--- a/gcc/testsuite/gcc.target/nvptx/uniform-simt-1.c
+++ b/gcc/testsuite/gcc.target/nvptx/uniform-simt-1.c
@@ -1,4 +1,4 @@
-/* { dg-options "-O2 -muniform-simt -misa=sm_70 -mptx=_" } */
+/* { dg-options "-O2 -muniform-simt -misa=sm_70 -mdejagnu-ptx=_" } */
 
 enum memmodel
 {
diff --git a/gcc/testsuite/gcc.target/nvptx/uniform-simt-2.c b/gcc/testsuite/gcc.target/nvptx/uniform-simt-2.c
index b1eee0d618f..6f2eebd81b7 100644
--- a/gcc/testsuite/gcc.target/nvptx/uniform-simt-2.c
+++ b/gcc/testsuite/gcc.target/nvptx/uniform-simt-2.c
@@ -1,4 +1,4 @@
-/* { dg-options "-O2 -muniform-simt -mptx=3.1 -misa=sm_30" } */
+/* { dg-options "-O2 -muniform-simt -mdejagnu-ptx=3.1 -misa=sm_30" } */
 
 enum memmodel
 {
diff --git a/gcc/testsuite/gcc.target/nvptx/uniform-simt-3.c b/gcc/testsuite/gcc.target/nvptx/uniform-simt-3.c
index f539cd3cafc..e9f5faef96c 100644
--- a/gcc/testsuite/gcc.target/nvptx/uniform-simt-3.c
+++ b/gcc/testsuite/gcc.target/nvptx/uniform-simt-3.c
@@ -1,4 +1,4 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -muniform-simt -misa=sm_70 -mptx=_" } */
+/* { dg-options "-O2 -muniform-simt -misa=sm_70 -mdejagnu-ptx=_" } */
 
 #include "atomic-store-2.c"
diff --git a/gcc/testsuite/gcc.target/nvptx/uniform-simt-4.c b/gcc/testsuite/gcc.target/nvptx/uniform-simt-4.c
index c33de7a4111..7c5b9cda1cf 100644
--- a/gcc/testsuite/gcc.target/nvptx/uniform-simt-4.c
+++ b/gcc/testsuite/gcc.target/nvptx/uniform-simt-4.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -muniform-simt -mptx=_" } */
+/* { dg-options "-O2 -muniform-simt -mdejagnu-ptx=_" } */
 
 enum memmodel
 {
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c b/libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c
index a49bc12064a..367c1cc138d 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c
@@ -1,5 +1,5 @@
 /* { dg-do run { target { offload_target_nvptx } } } */
-/* { dg-additional-options "-foffload=-misa=sm_30 -foffload=-mptx=_" } */
+/* { dg-additional-options "-foffload=-misa=sm_30 -foffload=-mdejagnu-ptx=_" } */
 /* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
 
 #include "declare-variant-3.h"
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3-sm35.c b/libgomp/testsuite/libgomp.c/declare-variant-3-sm35.c
index 9f71acb8738..23f979ca268 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3-sm35.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3-sm35.c
@@ -1,5 +1,5 @@
 /* { dg-do link { target { offload_target_nvptx } } } */
-/* { dg-additional-options "-foffload=-misa=sm_35 -foffload=-mptx=_" } */
+/* { dg-additional-options "-foffload=-misa=sm_35 -foffload=-mdejagnu-ptx=_" } */
 /* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
 
 #include "declare-variant-3.h"
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3-sm53.c b/libgomp/testsuite/libgomp.c/declare-variant-3-sm53.c
index fa713920ce0..d2b44d6e0d0 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3-sm53.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3-sm53.c
@@ -1,5 +1,5 @@
 /* { dg-do link { target { offload_target_nvptx } } } */
-/* { dg-additional-options "-foffload=-misa=sm_53 -foffload=-mptx=_" } */
+/* { dg-additional-options "-foffload=-misa=sm_53 -foffload=-mdejagnu-ptx=_" } */
 /* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
 
 #include "declare-variant-3.h"
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3-sm70.c b/libgomp/testsuite/libgomp.c/declare-variant-3-sm70.c
index 90f0116c582..d4fc436276e 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3-sm70.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3-sm70.c
@@ -1,5 +1,5 @@
 /* { dg-do link { target { offload_target_nvptx } } } */
-/* { dg-additional-options "-foffload=-misa=sm_70 -foffload=-mptx=_" } */
+/* { dg-additional-options "-foffload=-misa=sm_70 -foffload=-mdejagnu-ptx=_" } */
 /* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
 
 #include "declare-variant-3.h"
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3-sm75.c b/libgomp/testsuite/libgomp.c/declare-variant-3-sm75.c
index 86f2e72866a..069a9470e72 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3-sm75.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3-sm75.c
@@ -1,5 +1,5 @@
 /* { dg-do link { target { offload_target_nvptx } } } */
-/* { dg-additional-options "-foffload=-misa=sm_75 -foffload=-mptx=_" } */
+/* { dg-additional-options "-foffload=-misa=sm_75 -foffload=-mdejagnu-ptx=_" } */
 /* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
 
 #include "declare-variant-3.h"
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3-sm80.c b/libgomp/testsuite/libgomp.c/declare-variant-3-sm80.c
index de208d9bdd1..3a61dfe9535 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3-sm80.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3-sm80.c
@@ -1,5 +1,5 @@
 /* { dg-do link { target { offload_target_nvptx } } } */
-/* { dg-additional-options "-foffload=-misa=sm_80 -foffload=-mptx=_" } */
+/* { dg-additional-options "-foffload=-misa=sm_80 -foffload=-mdejagnu-ptx=_" } */
 /* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
 
 #include "declare-variant-3.h"
diff --git a/libgomp/testsuite/libgomp.c/reverse-offload-sm30.c b/libgomp/testsuite/libgomp.c/reverse-offload-sm30.c
index fbfeae1fd41..e4f07069293 100644
--- a/libgomp/testsuite/libgomp.c/reverse-offload-sm30.c
+++ b/libgomp/testsuite/libgomp.c/reverse-offload-sm30.c
@@ -1,5 +1,5 @@
 /* { dg-do link { target { offload_target_nvptx } } } */
-/* { dg-additional-options "-foffload-options=nvptx-none=-march=sm_30 -foffload=-mptx=_" } */
+/* { dg-additional-options "-foffload-options=nvptx-none=-march=sm_30 -foffload=-mdejagnu-ptx=_" } */
 
 #pragma omp requires reverse_offload
 
-- 
2.35.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-29  8:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-104364-4@http.gcc.gnu.org/bugzilla/>
     [not found] ` <bug-104364-4-ILKfZXTaRC@http.gcc.gnu.org/bugzilla/>
2022-02-04  7:21   ` nvptx multilib setup (was: [Bug target/104364] [12 Regression] OpenMP/nvptx regressions after "[nvptx] Add some support for .local atomics") Thomas Schwinge
2022-02-04 12:09     ` Tom de Vries
2022-05-13 14:20       ` nvptx multilib setup Thomas Schwinge
2022-09-28 13:50       ` DejaGnu: flags via 'RUNTESTFLAGS' overriding those specified in test cases Thomas Schwinge
2022-09-28 14:12         ` Jonathan Wakely
2022-09-28 15:39           ` Segher Boessenkool
2022-09-29  8:18             ` Thomas Schwinge

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).