]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LoongArch: Remove gawk extension from a generator script.
authorYang Yujie <yangyujie@loongson.cn>
Tue, 23 Jul 2024 02:04:26 +0000 (10:04 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Fri, 2 Aug 2024 01:37:10 +0000 (09:37 +0800)
gcc/ChangeLog:

* config/loongarch/genopts/gen-evolution.awk: Do not use
"length()" to compute the size of an array.

gcc/config/loongarch/genopts/gen-evolution.awk

index 4d105afa9067abe54e6ea4a657a3a7772e1165c8..1c8004e4146c78d6ec81a3e7f16a89a79f98f167 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/gawk
+#!/usr/bin/awk -f
 #
 # A simple script that generates loongarch-evolution.h
 # from genopts/isa-evolution.in
@@ -94,8 +94,9 @@ function gen_cpucfg_useful_idx()
         idx_bucket[cpucfg_word[i]] = 1
 
     delete idx_list
+    j = 1
     for (i in idx_bucket)
-        idx_list[length(idx_list)-1] = i+0
+        idx_list[j++] = i+0
     delete idx_bucket
 
     asort (idx_list)
@@ -108,7 +109,7 @@ function gen_cpucfg_useful_idx()
     print ""
 
     printf ("static constexpr int N_CPUCFG_WORDS = %d;\n",
-            idx_list[length(idx_list)] + 1)
+            idx_list[j - 1] + 1)
 
     delete idx_list
 }