aboutsummaryrefslogtreecommitdiff
path: root/gcc/optc-save-gen.awk
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-09-14 09:04:45 +0200
committerJakub Jelinek <jakub@redhat.com>2020-09-14 09:04:45 +0200
commitba948b37768c99cd8eb9f5b6fbd45fcf4bd15b78 (patch)
treee8d5a3b0d68993e3b4331fbdc12621cd28647879 /gcc/optc-save-gen.awk
parent4ac7b66958016225724084078e6e7937e23ffcd3 (diff)
downloadgcc-ba948b37768c99cd8eb9f5b6fbd45fcf4bd15b78.zip
gcc-ba948b37768c99cd8eb9f5b6fbd45fcf4bd15b78.tar.gz
gcc-ba948b37768c99cd8eb9f5b6fbd45fcf4bd15b78.tar.bz2
options: Save and restore opts_set for Optimization and Target options
> Seems a latent issue. > Neither cl_optimization_{save,restore} nor cl_target_option_{save,restore} > (nor any of the target hooks they call) saves or restores any opts_set > values, so I think opts_set can be trusted only during option processing (if > at all), but not later. > So, short term a fix would be IMHO just stop using opts_set altogether in > arm_configure_build_target, it doesn't make much sense to me, it should test > if those strings are non-NULL instead, or at least do that when it is > invoked from arm_option_restore (e.g. could be done by calling it with > opts instead of &global_options_set ). > Longer term, the question is if cl_optimization_{save,restore} and > cl_target_option_{save,restore} shouldn't be changed not to only > save/restore the options, but also save the opts_set flags. > It could be done e.g. by adding a bool array or set of bool members > to struct cl_optimization and struct cl_target_option , or even more compact > by using bitmasks, pack each 64 adjacent option flags into a UHWI element > of an array. So, I've tried under debugger how it behaves and seems global_options_set is really an or of whether an option has been ever seen as explicit, either on the command line or in any of the option pragmas or optimize/target attributes seen so far, so it isn't something that can be relied on. The following patch implements the saving/restoring of the opts_set bits (though only for the options/variables saved by the generic options-save.c code, for the target specific stuff that isn't handled by the generic code the opts_set argument is now passed to the hook and the backends can choose e.g. to use a TargetSave variable to save the flags either individually or together in some bitmask (or ignore it if they never need opts_set for the options). This patch itself doesn't fix the testcase failing on arm, but a follow up patch will. 2020-09-14 Jakub Jelinek <jakub@redhat.com> gcc/ * opt-read.awk: Also initialize extra_target_var_types array. * opth-gen.awk: Emit explicit_mask arrays to struct cl_optimization and cl_target_option. Adjust cl_optimization_save, cl_optimization_restore, cl_target_option_save and cl_target_option_restore declarations. * optc-save-gen.awk: Add opts_set argument to cl_optimization_save, cl_optimization_restore, cl_target_option_save and cl_target_option_restore functions and save or restore opts_set next to the opts values into or from explicit_mask arrays. In cl_target_option_eq and cl_optimization_option_eq compare explicit_mask arrays, in cl_target_option_hash and cl_optimization_hash hash them and in cl_target_option_stream_out, cl_target_option_stream_in, cl_optimization_stream_out and cl_optimization_stream_in stream them. * tree.h (build_optimization_node, build_target_option_node): Add opts_set argument. * tree.c (build_optimization_node): Add opts_set argument, pass it to cl_optimization_save. (build_target_option_node): Add opts_set argument, pass it to cl_target_option_save. * function.c (invoke_set_current_function_hook): Adjust cl_optimization_restore caller. * ipa-inline-transform.c (inline_call): Adjust cl_optimization_restore and build_optimization_node callers. * target.def (TARGET_OPTION_SAVE, TARGET_OPTION_RESTORE): Add opts_set argument. * target-globals.c (save_target_globals_default_opts): Adjust cl_optimization_restore callers. * toplev.c (process_options): Adjust build_optimization_node and cl_optimization_restore callers. (target_reinit): Adjust cl_optimization_restore caller. * tree-streamer-in.c (lto_input_ts_function_decl_tree_pointers): Adjust build_optimization_node and cl_optimization_restore callers. * doc/tm.texi: Updated. * config/aarch64/aarch64.c (aarch64_override_options): Adjust build_target_option_node caller. (aarch64_option_save, aarch64_option_restore): Add opts_set argument. (aarch64_set_current_function): Adjust cl_target_option_restore caller. (aarch64_option_valid_attribute_p): Adjust cl_target_option_save, cl_target_option_restore, cl_optimization_restore, build_optimization_node and build_target_option_node callers. * config/aarch64/aarch64-c.c (aarch64_pragma_target_parse): Adjust cl_target_option_restore and build_target_option_node callers. * config/arm/arm.c (arm_option_save, arm_option_restore): Add opts_set argument. (arm_option_override): Adjust cl_target_option_save, build_optimization_node and build_target_option_node callers. (arm_set_current_function): Adjust cl_target_option_restore caller. (arm_valid_target_attribute_tree): Adjust build_target_option_node caller. (add_attribute): Formatting fix. (arm_valid_target_attribute_p): Adjust cl_optimization_restore, cl_target_option_restore, arm_valid_target_attribute_tree and build_optimization_node callers. * config/arm/arm-c.c (arm_pragma_target_parse): Adjust cl_target_option_restore callers. * config/csky/csky.c (csky_option_override): Adjust build_target_option_node and cl_target_option_save callers. * config/gcn/gcn.c (gcn_fixup_accel_lto_options): Adjust build_optimization_node and cl_optimization_restore callers. * config/i386/i386-builtins.c (get_builtin_code_for_version): Adjust cl_target_option_save and cl_target_option_restore callers. * config/i386/i386-c.c (ix86_pragma_target_parse): Adjust build_target_option_node and cl_target_option_restore callers. * config/i386/i386-options.c (ix86_function_specific_save, ix86_function_specific_restore): Add opts_set arguments. (ix86_valid_target_attribute_tree): Adjust build_target_option_node caller. (ix86_valid_target_attribute_p): Adjust build_optimization_node, cl_optimization_restore, cl_target_option_restore, ix86_valid_target_attribute_tree and build_optimization_node callers. (ix86_option_override_internal): Adjust build_target_option_node caller. (ix86_reset_previous_fndecl, ix86_set_current_function): Adjust cl_target_option_restore callers. * config/i386/i386-options.h (ix86_function_specific_save, ix86_function_specific_restore): Add opts_set argument. * config/nios2/nios2.c (nios2_option_override): Adjust build_target_option_node caller. (nios2_option_save, nios2_option_restore): Add opts_set argument. (nios2_valid_target_attribute_tree): Adjust build_target_option_node caller. (nios2_valid_target_attribute_p): Adjust build_optimization_node, cl_optimization_restore, cl_target_option_save and cl_target_option_restore callers. (nios2_set_current_function, nios2_pragma_target_parse): Adjust cl_target_option_restore callers. * config/pru/pru.c (pru_option_override): Adjust build_target_option_node caller. (pru_set_current_function): Adjust cl_target_option_restore callers. * config/rs6000/rs6000.c (rs6000_debug_reg_global): Adjust cl_target_option_save caller. (rs6000_option_override_internal): Adjust build_target_option_node caller. (rs6000_valid_attribute_p): Adjust build_optimization_node, cl_optimization_restore, cl_target_option_save, cl_target_option_restore and build_target_option_node callers. (rs6000_pragma_target_parse): Adjust cl_target_option_restore and build_target_option_node callers. (rs6000_activate_target_options): Adjust cl_target_option_restore callers. (rs6000_function_specific_save, rs6000_function_specific_restore): Add opts_set argument. * config/s390/s390.c (s390_function_specific_restore): Likewise. (s390_option_override_internal): Adjust s390_function_specific_restore caller. (s390_option_override, s390_valid_target_attribute_tree): Adjust build_target_option_node caller. (s390_valid_target_attribute_p): Adjust build_optimization_node, cl_optimization_restore and cl_target_option_restore callers. (s390_activate_target_options): Adjust cl_target_option_restore caller. * config/s390/s390-c.c (s390_cpu_cpp_builtins): Adjust cl_target_option_save caller. (s390_pragma_target_parse): Adjust build_target_option_node and cl_target_option_restore callers. gcc/c-family/ * c-attribs.c (handle_optimize_attribute): Adjust cl_optimization_save, cl_optimization_restore and build_optimization_node callers. * c-pragma.c (handle_pragma_optimize): Adjust build_optimization_node caller. (handle_pragma_push_options): Adjust build_optimization_node and build_target_option_node callers. (handle_pragma_pop_options, handle_pragma_reset_options): Adjust cl_optimization_restore callers. gcc/go/ * go-gcc.cc (Gcc_backend::function): Adjust cl_optimization_save, cl_optimization_restore and build_optimization_node callers. gcc/ada/ * gcc-interface/trans.c (gigi): Adjust build_optimization_node caller.
Diffstat (limited to 'gcc/optc-save-gen.awk')
-rw-r--r--gcc/optc-save-gen.awk370
1 files changed, 360 insertions, 10 deletions
diff --git a/gcc/optc-save-gen.awk b/gcc/optc-save-gen.awk
index ff173fe..2e4787e 100644
--- a/gcc/optc-save-gen.awk
+++ b/gcc/optc-save-gen.awk
@@ -78,7 +78,8 @@ for (i = 0; i < n_opts; i++) {
print "/* Save optimization variables into a structure. */"
print "void";
-print "cl_optimization_save (struct cl_optimization *ptr, struct gcc_options *opts)";
+print "cl_optimization_save (struct cl_optimization *ptr, struct gcc_options *opts,";
+print " struct gcc_options *opts_set)";
print "{";
n_opt_char = 4;
@@ -116,9 +117,10 @@ for (i = 0; i < n_opts; i++) {
else if (otype ~ "^((un)?signed +)?short *$")
var_opt_short[n_opt_short++] = name;
- else if (otype ~ ("^enum +[_" alnum "]+ *"))
+ else if (otype ~ ("^enum +[_" alnum "]+ *")) {
+ var_opt_enum_type[n_opt_enum] = otype;
var_opt_enum[n_opt_enum++] = name;
-
+ }
else if (otype ~ "^((un)?signed +)?char *$") {
var_opt_char[n_opt_char++] = name;
if (otype ~ "^unsigned +char *$")
@@ -166,12 +168,88 @@ for (i = 0; i < n_opt_string; i++) {
print " ptr->x_" var_opt_string[i] " = opts->x_" var_opt_string[i] ";";
}
+print "";
+print " unsigned HOST_WIDE_INT mask = 0;";
+
+j = 0;
+k = 0;
+for (i = 0; i < n_opt_other; i++) {
+ print " if (opts_set->x_" var_opt_other[i] ") mask |= HOST_WIDE_INT_1U << " j ";";
+ j++;
+ if (j == 64) {
+ print " ptr->explicit_mask[" k "] = mask;";
+ print " mask = 0;";
+ j = 0;
+ k++;
+ }
+}
+
+for (i = 0; i < n_opt_int; i++) {
+ print " if (opts_set->x_" var_opt_int[i] ") mask |= HOST_WIDE_INT_1U << " j ";";
+ j++;
+ if (j == 64) {
+ print " ptr->explicit_mask[" k "] = mask;";
+ print " mask = 0;";
+ j = 0;
+ k++;
+ }
+}
+
+for (i = 0; i < n_opt_enum; i++) {
+ print " if (opts_set->x_" var_opt_enum[i] ") mask |= HOST_WIDE_INT_1U << " j ";";
+ j++;
+ if (j == 64) {
+ print " ptr->explicit_mask[" k "] = mask;";
+ print " mask = 0;";
+ j = 0;
+ k++;
+ }
+}
+
+for (i = 0; i < n_opt_short; i++) {
+ print " if (opts_set->x_" var_opt_short[i] ") mask |= HOST_WIDE_INT_1U << " j ";";
+ j++;
+ if (j == 64) {
+ print " ptr->explicit_mask[" k "] = mask;";
+ print " mask = 0;";
+ j = 0;
+ k++;
+ }
+}
+
+for (i = 0; i < n_opt_char; i++) {
+ print " if (opts_set->x_" var_opt_char[i] ") mask |= HOST_WIDE_INT_1U << " j ";";
+ j++;
+ if (j == 64) {
+ print " ptr->explicit_mask[" k "] = mask;";
+ print " mask = 0;";
+ j = 0;
+ k++;
+ }
+}
+
+for (i = 0; i < n_opt_string; i++) {
+ print " if (opts_set->x_" var_opt_string[i] ") mask |= HOST_WIDE_INT_1U << " j ";";
+ j++;
+ if (j == 64) {
+ print " ptr->explicit_mask[" k "] = mask;";
+ print " mask = 0;";
+ j = 0;
+ k++;
+ }
+}
+
+if (j != 0) {
+ print " ptr->explicit_mask[" k "] = mask;";
+}
+
print "}";
print "";
print "/* Restore optimization options from a structure. */";
print "void";
-print "cl_optimization_restore (struct gcc_options *opts, struct cl_optimization *ptr)";
+print "cl_optimization_restore (struct gcc_options *opts, struct gcc_options *opts_set,";
+print " struct cl_optimization *ptr)";
print "{";
for (i = 0; i < n_opt_other; i++) {
@@ -198,6 +276,77 @@ for (i = 0; i < n_opt_string; i++) {
print " opts->x_" var_opt_string[i] " = ptr->x_" var_opt_string[i] ";";
}
+print "";
+print " unsigned HOST_WIDE_INT mask;";
+
+j = 64;
+k = 0;
+for (i = 0; i < n_opt_other; i++) {
+ if (j == 64) {
+ print " mask = ptr->explicit_mask[" k "];";
+ k++;
+ j = 0;
+ }
+ print " opts_set->x_" var_opt_other[i] " = (mask & 1) != 0;";
+ print " mask >>= 1;"
+ j++;
+}
+
+for (i = 0; i < n_opt_int; i++) {
+ if (j == 64) {
+ print " mask = ptr->explicit_mask[" k "];";
+ k++;
+ j = 0;
+ }
+ print " opts_set->x_" var_opt_int[i] " = (mask & 1) != 0;";
+ print " mask >>= 1;"
+ j++;
+}
+
+for (i = 0; i < n_opt_enum; i++) {
+ if (j == 64) {
+ print " mask = ptr->explicit_mask[" k "];";
+ k++;
+ j = 0;
+ }
+ print " opts_set->x_" var_opt_enum[i] " = static_cast<" var_opt_enum_type[i] ">((mask & 1) != 0);";
+ print " mask >>= 1;"
+ j++;
+}
+
+for (i = 0; i < n_opt_short; i++) {
+ if (j == 64) {
+ print " mask = ptr->explicit_mask[" k "];";
+ k++;
+ j = 0;
+ }
+ print " opts_set->x_" var_opt_short[i] " = (mask & 1) != 0;";
+ print " mask >>= 1;"
+ j++;
+}
+
+for (i = 0; i < n_opt_char; i++) {
+ if (j == 64) {
+ print " mask = ptr->explicit_mask[" k "];";
+ k++;
+ j = 0;
+ }
+ print " opts_set->x_" var_opt_char[i] " = (mask & 1) != 0;";
+ print " mask >>= 1;"
+ j++;
+}
+
+for (i = 0; i < n_opt_string; i++) {
+ if (j == 64) {
+ print " mask = ptr->explicit_mask[" k "];";
+ k++;
+ j = 0;
+ }
+ print " opts_set->x_" var_opt_string[i] " = (mask & 1) ? \"\" : nullptr;";
+ print " mask >>= 1;"
+ j++;
+}
+
print " targetm.override_options_after_change ();";
print "}";
@@ -344,7 +493,8 @@ print "}";
print "";
print "/* Save selected option variables into a structure. */"
print "void";
-print "cl_target_option_save (struct cl_target_option *ptr, struct gcc_options *opts)";
+print "cl_target_option_save (struct cl_target_option *ptr, struct gcc_options *opts,";
+print " struct gcc_options *opts_set)";
print "{";
n_target_char = 0;
@@ -372,9 +522,10 @@ if (have_save) {
else if (otype ~ "^((un)?signed +)?short *$")
var_target_short[n_target_short++] = name;
- else if (otype ~ ("^enum +[_" alnum "]+ *$"))
+ else if (otype ~ ("^enum +[_" alnum "]+ *$")) {
+ var_target_enum_type[n_target_enum] = otype;
var_target_enum[n_target_enum++] = name;
-
+ }
else if (otype ~ "^((un)?signed +)?char *$") {
var_target_char[n_target_char++] = name;
if (otype ~ "^unsigned +char *$")
@@ -409,7 +560,7 @@ if (have_assert)
print "";
print " if (targetm.target_option.save)";
-print " targetm.target_option.save (ptr, opts);";
+print " targetm.target_option.save (ptr, opts, opts_set);";
print "";
for (i = 0; i < n_extra_target_vars; i++) {
@@ -440,12 +591,99 @@ for (i = 0; i < n_target_string; i++) {
print " ptr->x_" var_target_string[i] " = opts->x_" var_target_string[i] ";";
}
+print "";
+print " unsigned HOST_WIDE_INT mask = 0;";
+
+j = 0;
+k = 0;
+for (i = 0; i < n_extra_target_vars; i++) {
+ print " if (opts_set->x_" extra_target_vars[i] ") mask |= HOST_WIDE_INT_1U << " j ";";
+ j++;
+ if (j == 64) {
+ print " ptr->explicit_mask[" k "] = mask;";
+ print " mask = 0;";
+ j = 0;
+ k++;
+ }
+}
+
+for (i = 0; i < n_target_other; i++) {
+ print " if (opts_set->x_" var_target_other[i] ") mask |= HOST_WIDE_INT_1U << " j ";";
+ j++;
+ if (j == 64) {
+ print " ptr->explicit_mask[" k "] = mask;";
+ print " mask = 0;";
+ j = 0;
+ k++;
+ }
+}
+
+for (i = 0; i < n_target_enum; i++) {
+ print " if (opts_set->x_" var_target_enum[i] ") mask |= HOST_WIDE_INT_1U << " j ";";
+ j++;
+ if (j == 64) {
+ print " ptr->explicit_mask[" k "] = mask;";
+ print " mask = 0;";
+ j = 0;
+ k++;
+ }
+}
+
+for (i = 0; i < n_target_int; i++) {
+ print " if (opts_set->x_" var_target_int[i] ") mask |= HOST_WIDE_INT_1U << " j ";";
+ j++;
+ if (j == 64) {
+ print " ptr->explicit_mask[" k "] = mask;";
+ print " mask = 0;";
+ j = 0;
+ k++;
+ }
+}
+
+for (i = 0; i < n_target_short; i++) {
+ print " if (opts_set->x_" var_target_short[i] ") mask |= HOST_WIDE_INT_1U << " j ";";
+ j++;
+ if (j == 64) {
+ print " ptr->explicit_mask[" k "] = mask;";
+ print " mask = 0;";
+ j = 0;
+ k++;
+ }
+}
+
+for (i = 0; i < n_target_char; i++) {
+ print " if (opts_set->x_" var_target_char[i] ") mask |= HOST_WIDE_INT_1U << " j ";";
+ j++;
+ if (j == 64) {
+ print " ptr->explicit_mask[" k "] = mask;";
+ print " mask = 0;";
+ j = 0;
+ k++;
+ }
+}
+
+for (i = 0; i < n_target_string; i++) {
+ print " if (opts_set->x_" var_target_string[i] ") mask |= HOST_WIDE_INT_1U << " j ";";
+ j++;
+ if (j == 64) {
+ print " ptr->explicit_mask[" k "] = mask;";
+ print " mask = 0;";
+ j = 0;
+ k++;
+ }
+}
+
+if (j != 0) {
+ print " ptr->explicit_mask[" k "] = mask;";
+}
+
print "}";
print "";
print "/* Restore selected current options from a structure. */";
print "void";
-print "cl_target_option_restore (struct gcc_options *opts, struct cl_target_option *ptr)";
+print "cl_target_option_restore (struct gcc_options *opts, struct gcc_options *opts_set,";
+print " struct cl_target_option *ptr)";
print "{";
for (i = 0; i < n_extra_target_vars; i++) {
@@ -476,11 +714,101 @@ for (i = 0; i < n_target_string; i++) {
print " opts->x_" var_target_string[i] " = ptr->x_" var_target_string[i] ";";
}
+print "";
+print " unsigned HOST_WIDE_INT mask;";
+
+j = 64;
+k = 0;
+for (i = 0; i < n_extra_target_vars; i++) {
+ if (j == 64) {
+ print " mask = ptr->explicit_mask[" k "];";
+ k++;
+ j = 0;
+ }
+ if (extra_target_var_types[i] ~ ("^enum +[_" alnum "]+ *$")) {
+ print " opts_set->x_" extra_target_vars[i] " = static_cast<" extra_target_var_types[i] ">((mask & 1) != 0);";
+ }
+ else if (extra_target_var_types[i] ~ "^const char \\**$") {
+ print " opts_set->x_" extra_target_vars[i] " = (mask & 1) ? \"\" : nullptr;";
+ }
+ else {
+ print " opts_set->x_" extra_target_vars[i] " = (mask & 1) != 0;";
+ }
+ print " mask >>= 1;"
+ j++;
+}
+
+for (i = 0; i < n_target_other; i++) {
+ if (j == 64) {
+ print " mask = ptr->explicit_mask[" k "];";
+ k++;
+ j = 0;
+ }
+ print " opts_set->x_" var_target_other[i] " = (mask & 1) != 0;";
+ print " mask >>= 1;"
+ j++;
+}
+
+for (i = 0; i < n_target_enum; i++) {
+ if (j == 64) {
+ print " mask = ptr->explicit_mask[" k "];";
+ k++;
+ j = 0;
+ }
+ print " opts_set->x_" var_target_enum[i] " = static_cast<" var_target_enum_type[i] ">((mask & 1) != 0);";
+ print " mask >>= 1;"
+ j++;
+}
+
+for (i = 0; i < n_target_int; i++) {
+ if (j == 64) {
+ print " mask = ptr->explicit_mask[" k "];";
+ k++;
+ j = 0;
+ }
+ print " opts_set->x_" var_target_int[i] " = (mask & 1) != 0;";
+ print " mask >>= 1;"
+ j++;
+}
+
+for (i = 0; i < n_target_short; i++) {
+ if (j == 64) {
+ print " mask = ptr->explicit_mask[" k "];";
+ k++;
+ j = 0;
+ }
+ print " opts_set->x_" var_target_short[i] " = (mask & 1) != 0;";
+ print " mask >>= 1;"
+ j++;
+}
+
+for (i = 0; i < n_target_char; i++) {
+ if (j == 64) {
+ print " mask = ptr->explicit_mask[" k "];";
+ k++;
+ j = 0;
+ }
+ print " opts_set->x_" var_target_char[i] " = (mask & 1) != 0;";
+ print " mask >>= 1;"
+ j++;
+}
+
+for (i = 0; i < n_target_string; i++) {
+ if (j == 64) {
+ print " mask = ptr->explicit_mask[" k "];";
+ k++;
+ j = 0;
+ }
+ print " opts_set->x_" var_target_string[i] " = (mask & 1) ? \"\" : nullptr;";
+ print " mask >>= 1;"
+ j++;
+}
+
# This must occur after the normal variables in case the code depends on those
# variables.
print "";
print " if (targetm.target_option.restore)";
-print " targetm.target_option.restore (opts, ptr);";
+print " targetm.target_option.restore (opts, opts_set, ptr);";
print "}";
@@ -726,6 +1054,10 @@ for (i = 0; i < n_target_val; i++) {
print " return false;";
}
+print " for (size_t i = 0; i < sizeof (ptr1->explicit_mask) / sizeof (ptr1->explicit_mask[0]); i++)";
+print " if (ptr1->explicit_mask[i] != ptr2->explicit_mask[i])";
+print " return false;"
+
print " return true;";
print "}";
@@ -754,6 +1086,8 @@ for (i = 0; i < n_target_val; i++) {
name = var_target_val[i]
print " hstate.add_hwi (ptr->" name");";
}
+print " for (size_t i = 0; i < sizeof (ptr->explicit_mask) / sizeof (ptr->explicit_mask[0]); i++)";
+print " hstate.add_hwi (ptr->explicit_mask[i]);";
print " return hstate.end ();";
print "}";
@@ -778,6 +1112,10 @@ for (i = 0; i < n_target_val; i++) {
name = var_target_val[i]
print " bp_pack_value (bp, ptr->" name", 64);";
}
+
+print " for (size_t i = 0; i < sizeof (ptr->explicit_mask) / sizeof (ptr->explicit_mask[0]); i++)";
+print " bp_pack_value (bp, ptr->explicit_mask[i], 64);";
+
print "}";
print "";
@@ -804,6 +1142,9 @@ for (i = 0; i < n_target_val; i++) {
print " ptr->" name" = (" var_target_val_type[i] ") bp_unpack_value (bp, 64);";
}
+print " for (size_t i = 0; i < sizeof (ptr->explicit_mask) / sizeof (ptr->explicit_mask[0]); i++)";
+print " ptr->explicit_mask[i] = bp_unpack_value (bp, 64);";
+
print "}";
print "/* free heap memory used by target options */";
@@ -869,6 +1210,8 @@ for (i = 0; i < n_opt_val; i++) {
else
print " hstate.add_hwi (ptr->" name");";
}
+print " for (size_t i = 0; i < sizeof (ptr->explicit_mask) / sizeof (ptr->explicit_mask[0]); i++)";
+print " hstate.add_hwi (ptr->explicit_mask[i]);";
print " return hstate.end ();";
print "}";
@@ -896,6 +1239,9 @@ for (i = 0; i < n_opt_val; i++) {
print " return false;";
}
}
+print " for (size_t i = 0; i < sizeof (ptr1->explicit_mask) / sizeof (ptr1->explicit_mask[0]); i++)";
+print " if (ptr1->explicit_mask[i] != ptr2->explicit_mask[i])";
+print " return false;"
print " return true;";
print "}";
@@ -914,6 +1260,8 @@ for (i = 0; i < n_opt_val; i++) {
else
print " bp_pack_value (bp, ptr->" name", 64);";
}
+print " for (size_t i = 0; i < sizeof (ptr->explicit_mask) / sizeof (ptr->explicit_mask[0]); i++)";
+print " bp_pack_value (bp, ptr->explicit_mask[i], 64);";
print "}";
print "";
@@ -935,6 +1283,8 @@ for (i = 0; i < n_opt_val; i++) {
else
print " ptr->" name" = (" var_opt_val_type[i] ") bp_unpack_value (bp, 64);";
}
+print " for (size_t i = 0; i < sizeof (ptr->explicit_mask) / sizeof (ptr->explicit_mask[0]); i++)";
+print " ptr->explicit_mask[i] = bp_unpack_value (bp, 64);";
print "}";
print "/* Free heap memory used by optimization options */";
print "void";