]> gcc.gnu.org Git - gcc.git/commitdiff
options: Prevent multidimensional arrays [PR111664]
authorKito Cheng <kito.cheng@sifive.com>
Mon, 2 Oct 2023 02:50:42 +0000 (10:50 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Wed, 4 Oct 2023 13:37:40 +0000 (21:37 +0800)
Multidimensional arrary is gawk extension, and we accidentally
introduced that in recent commit[1].

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e4a4b8e983bac865eb435b11798e38d633b98942

gcc/ChangeLog:

PR bootstrap/111664
* opt-read.awk: Drop multidimensional arrays.
* opth-gen.awk: Ditto.

gcc/opt-read.awk
gcc/opth-gen.awk

index fcf928539574c06b45089f9118136aec6c624b04..f74d8478f7281c162603b27a8101a130b80709c7 100644 (file)
@@ -123,7 +123,7 @@ BEGIN {
                        }
                        else {
                                target_var = opt_args("Var", $0)
-                                if (target_var)
+                               if (target_var)
                                {
                                        target_var = opt_args("Var", $1)
                                        var_index = find_index(target_var, target_vars, n_target_vars)
@@ -131,7 +131,7 @@ BEGIN {
                                        {
                                                target_vars[n_target_vars++] = target_var
                                        }
-                                       other_masks[var_index][n_other_mask[var_index]++] = name
+                                       other_masks[var_index "," n_other_mask[var_index]++] = name
                                }
                                else
                                {
index 70ca3d3771924d8737cb9c3ae60e7a4f3a41752e..c4398be2f3ae2c2a19a209733fe0b2b738b62ca5 100644 (file)
@@ -412,9 +412,9 @@ for (i = 0; i < n_target_vars; i++)
                continue
        for (j = 0; j < n_other_mask[i]; j++)
        {
-               print "#define MASK_" other_masks[i][j] " (1U << " other_masknum[i][""]++ ")"
+               print "#define MASK_" other_masks[i "," j] " (1U << " other_masknum[i]++ ")"
        }
-       if (other_masknum[i][""] > 32)
+       if (other_masknum[i] > 32)
                print "#error too many target masks for" extra_target_vars[i]
 }
 
@@ -437,8 +437,8 @@ for (i = 0; i < n_target_vars; i++)
                continue
        for (j = 0; j < n_other_mask[i]; j++)
        {
-               print "#define TARGET_" other_masks[i][j] \
-                     " ((" target_vars[i] " & MASK_" other_masks[i][j] ") != 0)"
+               print "#define TARGET_" other_masks[i "," j] \
+                     " ((" target_vars[i] " & MASK_" other_masks[i "," j] ") != 0)"
        }
 }
 print ""
This page took 0.068536 seconds and 5 git commands to generate.