public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Lehua Ding" <lehua.ding@rivai.ai>
To: "Kito Cheng" <kito.cheng@gmail.com>, "Jeff Law" <jeffreyalaw@gmail.com>
Cc: palmer <palmer@rivosinc.com>, 钟居哲 <juzhe.zhong@rivai.ai>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
	"Robin Dapp" <rdapp.gcc@gmail.com>
Subject: Re: [PATCH] RISC-V: Throw compilation error for unknown sub-extension or supervisor extension
Date: Thu, 13 Jul 2023 16:34:54 +0800	[thread overview]
Message-ID: <tencent_6D5F8A0957211CE30B92D2AC@qq.com> (raw)
In-Reply-To: <CA+yXCZCWNpB=qyt6w0U0V=CTXWsF6CJB7w=R-vqX7QYVN0H+NQ@mail.gmail.com>

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

Thanks for review. I uploaded version V2, which addresses Kito's comments,
along with two changes. The first is to reduce repeated errors, which are currently
reported at least twice. The second is to report as many mistakes as possible.


V2 URL:&nbsp;https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624377.html


Best,
Lehua
&nbsp;
------------------&nbsp;Original&nbsp;------------------
From: &nbsp;"Kito&nbsp;Cheng"<kito.cheng@gmail.com&gt;;
Date: &nbsp;Thu, Jul 13, 2023 10:04 AM
To: &nbsp;"Jeff Law"<jeffreyalaw@gmail.com&gt;; 
Cc: &nbsp;"palmer"<palmer@rivosinc.com&gt;; "juzhe.zhong"<juzhe.zhong@rivai.ai&gt;; "lehua.ding"<lehua.ding@rivai.ai&gt;; "gcc-patches"<gcc-patches@gcc.gnu.org&gt;; "Robin Dapp"<rdapp.gcc@gmail.com&gt;; 
Subject: &nbsp;Re: [PATCH] RISC-V: Throw compilation error for unknown sub-extension or supervisor extension

&nbsp;

That's intentional before, since some time binutils may have supported
that but the compiler doesn't, so GCC just bypasses that to binutils
to let binutils reject those unknown extensions.

But I am considering rejecting those extensions or adding more checks
on the GCC side recently too, because accepting unknown extensions
might cause problems on the architecture extension test macro[1], it
makes the value become unreliable if the extension version info isn't
in GCC yet.

So I am OK with this change but two minor comments :

---
&gt; riscv64-unknown-elf-gcc: error: '-march=rv64gcv_zvl128_s123': extension 'zvl' starts with `z` but is not a standard sub-extension

I would like to say it's `unsupported standard extension` rather than
`not a standard sub-extension`.

Because some extensions have just become ratified but GCC is
unsupported yet, so `not a standard sub-extension` might confuse IMO.
and why `extension` rather than `sub-extension`: IIRC `sub-extension`
was used as an official term long ago, but it is called standard
extension now[2].

----
&gt; riscv64-unknown-elf-gcc: error: '-march=rv64gcv_zvl128_s123': extension 's123' start with `s` but not a standard supervisor extension
`is` is missing.

----

Also I would like to reject unknown single letter extensions and `x`
extensions too, for the same reason as the other two, except that make
the architecture extension test macro less useful.


[1] https://github.com/riscv-non-isa/riscv-c-api-doc/blob/master/riscv-c-api.md#architecture-extension-test-macro
[2] https://github.com/riscv/riscv-isa-manual/blob/main/src/naming.adoc#additional-standard-extension-names

      reply	other threads:[~2023-07-13  8:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12  3:27 Lehua Ding
2023-07-12  3:30 ` juzhe.zhong
2023-07-12 16:02   ` Jeff Law
2023-07-12 16:32     ` Palmer Dabbelt
2023-07-12 16:35       ` Jeff Law
2023-07-13  2:04         ` Kito Cheng
2023-07-13  8:34           ` Lehua Ding [this message]

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=tencent_6D5F8A0957211CE30B92D2AC@qq.com \
    --to=lehua.ding@rivai.ai \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=juzhe.zhong@rivai.ai \
    --cc=kito.cheng@gmail.com \
    --cc=palmer@rivosinc.com \
    --cc=rdapp.gcc@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).