[gcc r11-6612] options: properly compare string arguments
Martin Liska
marxin@gcc.gnu.org
Tue Jan 12 13:04:44 GMT 2021
https://gcc.gnu.org/g:e91910d3576eeac714c93ec25ea3b15012007903
commit r11-6612-ge91910d3576eeac714c93ec25ea3b15012007903
Author: Martin Liska <mliska@suse.cz>
Date: Tue Jan 12 13:20:18 2021 +0100
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:
---
gcc/optc-save-gen.awk | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
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 ")))";
More information about the Gcc-cvs
mailing list