From: Martin Liska Date: Tue, 12 Jan 2021 12:20:18 +0000 (+0100) Subject: options: properly compare string arguments X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e91910d3576eeac714c93ec25ea3b15012007903;p=gcc.git options: properly compare string arguments Similarly to 7f967bd2a7ba156ede3fbb147e66dea5fb7137a6, we need to compare string with strcmp. gcc/ChangeLog: PR c++/97284 * optc-save-gen.awk: Compare also n_target_save vars with strcmp. --- diff --git a/gcc/optc-save-gen.awk b/gcc/optc-save-gen.awk index 85debfe0b64..b1f85928275 100644 --- a/gcc/optc-save-gen.awk +++ b/gcc/optc-save-gen.awk @@ -1036,8 +1036,10 @@ for (i = 0; i < n_target_save; i++) { type = var; sub("^.*[ *]", "", name) sub(" *" name "$", "", type) - if (target_save_decl[i] ~ "^const char \\*+[_" alnum "]+$") + if (target_save_decl[i] ~ "^const char \\*+[_" alnum "]+$") { var_target_str[n_target_str++] = name; + string_options_names[name]++ + } else { if (target_save_decl[i] ~ " .*\\[.+\\]+$") { size = name; @@ -1451,7 +1453,7 @@ for (i = 0; i < n_opts; i++) { continue; checked_options[name]++ - if (name in string_options_names) { + if (name in string_options_names || ("x_" name) in string_options_names) { print " if (ptr1->x_" name " != ptr2->x_" name ""; print " && (!ptr1->x_" name" || !ptr2->x_" name print " || strcmp (ptr1->x_" name", ptr2->x_" name ")))";