When there is an extension with different versions, the result of the 
TARGET_COMPUTE_MULTILIB hook
is generally wrong, so the version needs to be considered.

gcc/ChangeLog:

        * common/config/riscv/riscv-common.cc (riscv_subset_list::match_score): 
Match the version
        of each extension.
---
 gcc/common/config/riscv/riscv-common.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gcc/common/config/riscv/riscv-common.cc 
b/gcc/common/config/riscv/riscv-common.cc
index ebc1ed7d7e4..0a15ff705d1 100644
--- a/gcc/common/config/riscv/riscv-common.cc
+++ b/gcc/common/config/riscv/riscv-common.cc
@@ -331,10 +331,9 @@ riscv_subset_list::match_score (riscv_subset_list *list) 
const
   /* list must be subset of current this list, otherwise it not safe to
      link.
      TODO: We might give different weight for each extension, but the rule 
could
-          be complicated.
-     TODO: We might consider the version of each extension.  */
+          be complicated.  */
   for (s = list->m_head; s != NULL; s = s->next)
-    if (this->lookup (s->name.c_str ()) != NULL)
+    if (this->lookup (s->name.c_str (), s->major_version, s->minor_version) != 
NULL)
       score++;
     else
       return 0;
-- 
2.17.1

Reply via email to