public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Songhe Zhu <zhusonghe@eswincomputing.com>
To: gcc-patches@gcc.gnu.org
Cc: kito.cheng@gmail.com, palmer@dabbelt.com,
	Songhe Zhu <zhusonghe@eswincomputing.com>
Subject: [PATCH] RISC-V: Fix loss of function to script 'multilib-generator'
Date: Tue, 21 Mar 2023 15:38:49 +0800	[thread overview]
Message-ID: <20230321073849.21470-1-zhusonghe@eswincomputing.com> (raw)

The arch 'rv32imac' will not be created when excuting
'./multilib-generator rv32imc-ilp32--a'

The output is:
MULTILIB_OPTIONS = march=rv32imc mabi=ilp32
MULTILIB_DIRNAMES = rv32imc ilp32
MULTILIB_REQUIRED = march=rv32imc/mabi=ilp32
MULTILIB_REUSE =

Analysis : The alts:['rv32imc', 'rv32imac'] will change
to ['rv32imac', 'rv32imc'] through function:unique(alts) processing,
This is the wrong alts should not be changed.
This patch fix it.

gcc/ChangLog:
	* config/riscv/multilib-generator: Adjusting the loop of 'alt' in 'alts'.

Signed-off-by: Songhe Zhu <zhusonghe@eswincomputing.com>
---
 gcc/config/riscv/multilib-generator | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/riscv/multilib-generator b/gcc/config/riscv/multilib-generator
index 9a6ce0223c9..0a3d4c07757 100755
--- a/gcc/config/riscv/multilib-generator
+++ b/gcc/config/riscv/multilib-generator
@@ -175,7 +175,7 @@ for cmodel in cmodels:
     # Drop duplicated entry.
     alts = unique(alts)
 
-    for alt in alts[1:]:
+    for alt in alts:
       if alt == arch:
         continue
       arches[alt] = 1
-- 
2.17.1


             reply	other threads:[~2023-03-21  7:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21  7:38 Songhe Zhu [this message]
2023-03-23  8:33 ` Kito Cheng

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=20230321073849.21470-1-zhusonghe@eswincomputing.com \
    --to=zhusonghe@eswincomputing.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kito.cheng@gmail.com \
    --cc=palmer@dabbelt.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).