public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Set require-effective-target rv64 for PR113742
@ 2024-02-14 19:46 Edwin Lu
  2024-02-14 20:09 ` Robin Dapp
  0 siblings, 1 reply; 5+ messages in thread
From: Edwin Lu @ 2024-02-14 19:46 UTC (permalink / raw)
  To: gcc-patches; +Cc: gnu-toolchain, monk.chiang, jeffreyalaw, Edwin Lu

The testcase pr113742.c is failing for 32 bit targets due to the following cc1
error:
cc1: error: ABI requries '-march=rv64'

Disable testing on rv32 targets

	PR target/113742

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/pr113742.c: add require-effective-target

Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
---
 gcc/testsuite/gcc.target/riscv/pr113742.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/testsuite/gcc.target/riscv/pr113742.c b/gcc/testsuite/gcc.target/riscv/pr113742.c
index ab8934c2a8a..9cea92ed97c 100644
--- a/gcc/testsuite/gcc.target/riscv/pr113742.c
+++ b/gcc/testsuite/gcc.target/riscv/pr113742.c
@@ -1,4 +1,5 @@
 //* { dg-do compile } */
 /* { dg-options "-O2 -finstrument-functions -mabi=lp64d -mcpu=sifive-p670" } */
+/* { dg-require-effective-target rv64 } */
 
 void foo(void) {}
-- 
2.34.1


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

* Re: [PATCH] RISC-V: Set require-effective-target rv64 for PR113742
  2024-02-14 19:46 [PATCH] RISC-V: Set require-effective-target rv64 for PR113742 Edwin Lu
@ 2024-02-14 20:09 ` Robin Dapp
  2024-02-14 21:34   ` Edwin Lu
  0 siblings, 1 reply; 5+ messages in thread
From: Robin Dapp @ 2024-02-14 20:09 UTC (permalink / raw)
  To: Edwin Lu, gcc-patches; +Cc: rdapp.gcc, gnu-toolchain, monk.chiang, jeffreyalaw

On 2/14/24 20:46, Edwin Lu wrote:
> The testcase pr113742.c is failing for 32 bit targets due to the following cc1
> error:
> cc1: error: ABI requries '-march=rv64'

I think we usually just add exactly this to the test options (so
it is always run rather than just on a 64-bit target.

Regards
 Robin


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

* Re: [PATCH] RISC-V: Set require-effective-target rv64 for PR113742
  2024-02-14 20:09 ` Robin Dapp
@ 2024-02-14 21:34   ` Edwin Lu
  2024-02-15 11:43     ` Robin Dapp
  0 siblings, 1 reply; 5+ messages in thread
From: Edwin Lu @ 2024-02-14 21:34 UTC (permalink / raw)
  To: Robin Dapp, gcc-patches; +Cc: gnu-toolchain, monk.chiang, jeffreyalaw


On 2/14/2024 12:09 PM, Robin Dapp wrote:
> On 2/14/24 20:46, Edwin Lu wrote:
>> The testcase pr113742.c is failing for 32 bit targets due to the following cc1
>> error:
>> cc1: error: ABI requries '-march=rv64'
> I think we usually just add exactly this to the test options (so
> it is always run rather than just on a 64-bit target.
>
> Regards
>   Robin

Ah oops I glanced over the /* { dg-do compile } */part. It should be 
fine to add '-march=rv64gc' instead then?

Edwin


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

* Re: [PATCH] RISC-V: Set require-effective-target rv64 for PR113742
  2024-02-14 21:34   ` Edwin Lu
@ 2024-02-15 11:43     ` Robin Dapp
  2024-02-20  9:37       ` Monk Chiang
  0 siblings, 1 reply; 5+ messages in thread
From: Robin Dapp @ 2024-02-15 11:43 UTC (permalink / raw)
  To: Edwin Lu, gcc-patches, Kito Cheng
  Cc: rdapp.gcc, gnu-toolchain, monk.chiang, jeffreyalaw

> Ah oops I glanced over the /* { dg-do compile } */part. It should be
> fine to add '-march=rv64gc' instead then?

Hmm it's a bit tricky.  So generally -mcpu=sifive-p670 includes rv64
but it does not override a previously specified -march=rv32 (that might
have been added by the test harness or the test target).  It looks
like it does override a (build option and thus not directly specified
when compiling) --with-arch=rv32.

For now I'd stick with something like -march=rv64gc -mtune=sifive-p670
(but please check if the original problem does occur with this).
While you're at it you could delete the redundant '/' in the first
line.

In general it's a bit counterintuitive a test specifying a
particular CPU (that supports several extensions) might have
those overridden when e.g. testing on a rv32 target not supporting
those.  We also do not support cpu names in the march string
so there is no nice way of overriding previously specified marchs.

Kito: Any idea regarding this?  I read in your commit message that
mcpu has lower precedence than march.  Right now that allows us to
somewhat silently remove architecture options that are specified
last on the command line.

aarch64 warns in case something is in conflict, maybe we should do
that as well?

At least I find it a bit annoying that we don't have a way of
saying:
"This test always needs to be compiled with all arch features of
cpu = ..." and rather need to specify -march=rv64gcv_z..._z...

Without having this thought through, can't mcpu be of kind of
similar precedence to march and we'd let the one specified last
"win" in case of conflicts?  Possibly with an exception for
the 32/64 bit.  Does LLVM not have this problem?

Regards
 Robin


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

* Re: [PATCH] RISC-V: Set require-effective-target rv64 for PR113742
  2024-02-15 11:43     ` Robin Dapp
@ 2024-02-20  9:37       ` Monk Chiang
  0 siblings, 0 replies; 5+ messages in thread
From: Monk Chiang @ 2024-02-20  9:37 UTC (permalink / raw)
  To: Robin Dapp; +Cc: Edwin Lu, gcc-patches, Kito Cheng, gnu-toolchain, jeffreyalaw

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

Hi Edwin,
I think just replace to:
/* { dg-options "-O2 -finstrument-functions -mabi=lp64d -march=rv64gc
-mtune=sifive-p600-series" } */

On Thu, Feb 15, 2024 at 7:43 PM Robin Dapp <rdapp.gcc@gmail.com> wrote:

> > Ah oops I glanced over the /* { dg-do compile } */part. It should be
> > fine to add '-march=rv64gc' instead then?
>
> Hmm it's a bit tricky.  So generally -mcpu=sifive-p670 includes rv64
> but it does not override a previously specified -march=rv32 (that might
> have been added by the test harness or the test target).  It looks
> like it does override a (build option and thus not directly specified
> when compiling) --with-arch=rv32.
>
> For now I'd stick with something like -march=rv64gc -mtune=sifive-p670
> (but please check if the original problem does occur with this).
> While you're at it you could delete the redundant '/' in the first
> line.
>
> In general it's a bit counterintuitive a test specifying a
> particular CPU (that supports several extensions) might have
> those overridden when e.g. testing on a rv32 target not supporting
> those.  We also do not support cpu names in the march string
> so there is no nice way of overriding previously specified marchs.
>
> Kito: Any idea regarding this?  I read in your commit message that
> mcpu has lower precedence than march.  Right now that allows us to
> somewhat silently remove architecture options that are specified
> last on the command line.
>
> aarch64 warns in case something is in conflict, maybe we should do
> that as well?
>
> At least I find it a bit annoying that we don't have a way of
> saying:
> "This test always needs to be compiled with all arch features of
> cpu = ..." and rather need to specify -march=rv64gcv_z..._z...
>
> Without having this thought through, can't mcpu be of kind of
> similar precedence to march and we'd let the one specified last
> "win" in case of conflicts?  Possibly with an exception for
> the 32/64 bit.  Does LLVM not have this problem?
>
> Regards
>  Robin
>
>

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

end of thread, other threads:[~2024-02-20  9:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-14 19:46 [PATCH] RISC-V: Set require-effective-target rv64 for PR113742 Edwin Lu
2024-02-14 20:09 ` Robin Dapp
2024-02-14 21:34   ` Edwin Lu
2024-02-15 11:43     ` Robin Dapp
2024-02-20  9:37       ` Monk Chiang

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