+2017-01-07 Alexandre Oliva <aoliva@redhat.com>
+
+ * doc/options.texi (PerFunction): New.
+ * opt-functions.awk (switch_flags): Map both Optimization and
+ PerFunction to CL_OPTIMIZATION.
+ * opth-gen.awk: Test for PerFunction flag along with
+ Optimization.
+ * optc-save-gen.awk: Likewise. Introduce var_opt_hash and set
+ it only when the latter is present. Skip those that don't in
+ the hash function generator.
+ * common.opt (fvar-tracking): Mark as PerFunction instead of
+ Optimization.
+ (fvar-tracking-assignments): Likewise.
+ (fvar-tracking-assignments-toggle): Likewise.
+ (fvar-tracking-uninit): Likewise.
+
2017-01-07 Jakub Jelinek <jakub@redhat.com>
PR translation/79018
; will be set according to optimize, debug_info_level and debug_hooks
; in process_options ().
fvar-tracking
-Common Report Var(flag_var_tracking) Init(2) Optimization
+Common Report Var(flag_var_tracking) Init(2) PerFunction
Perform variable tracking.
; Positive if we should track variables at assignments, negative if
; annotations. When flag_var_tracking_assignments ==
; AUTODETECT_VALUE it will be set according to flag_var_tracking.
fvar-tracking-assignments
-Common Report Var(flag_var_tracking_assignments) Init(2) Optimization
+Common Report Var(flag_var_tracking_assignments) Init(2) PerFunction
Perform variable tracking by annotating assignments.
; Nonzero if we should toggle flag_var_tracking_assignments after
; processing options and computing its default. */
fvar-tracking-assignments-toggle
-Common Report Var(flag_var_tracking_assignments_toggle) Optimization
+Common Report Var(flag_var_tracking_assignments_toggle) PerFunction
Toggle -fvar-tracking-assignments.
; Positive if we should track uninitialized variables, negative if
; annotations. When flag_var_tracking_uninit == AUTODETECT_VALUE it
; will be set according to flag_var_tracking.
fvar-tracking-uninit
-Common Report Var(flag_var_tracking_uninit) Optimization
+Common Report Var(flag_var_tracking_uninit) PerFunction
Perform variable tracking and also tag variables that are uninitialized.
ftree-vectorize
@code{Var} should be saved and restored when the optimization level is
changed with @code{optimize} attributes.
+@item PerFunction
+This is an option that can be overridden on a per-function basis.
+@code{Optimization} implies @code{PerFunction}, but options that do not
+affect executable code generation may use this flag instead, so that the
+option is not taken into account in ways that might affect executable
+code generation.
+
@item Undocumented
The option is deliberately missing documentation and should not
be included in the @option{--help} output.
test_flag("Undocumented", flags, " | CL_UNDOCUMENTED") \
test_flag("NoDWARFRecord", flags, " | CL_NO_DWARF_RECORD") \
test_flag("Warning", flags, " | CL_WARNING") \
- test_flag("Optimization", flags, " | CL_OPTIMIZATION")
+ test_flag("(Optimization|PerFunction)", flags, " | CL_OPTIMIZATION")
sub( "^0 \\| ", "", result )
return result
}
# cache.
for (i = 0; i < n_opts; i++) {
- if (flag_set_p("Optimization", flags[i])) {
+ if (flag_set_p("(Optimization|PerFunction)", flags[i])) {
name = var_name(flags[i])
if(name == "")
continue;
var_opt_val_type[1] = "char "
var_opt_val_type[2] = "char "
for (i = 0; i < n_opts; i++) {
- if (flag_set_p("Optimization", flags[i])) {
+ if (flag_set_p("(Optimization|PerFunction)", flags[i])) {
name = var_name(flags[i])
if(name == "")
continue;
otype = var_type_struct(flags[i])
var_opt_val_type[n_opt_val] = otype;
var_opt_val[n_opt_val++] = "x_" name;
+ var_opt_hash[n_opt_val] = flag_set_p("Optimization", flags[i]);
}
}
print "";
print "{";
print " inchash::hash hstate;";
for (i = 0; i < n_opt_val; i++) {
+ if (!var_opt_hash[i])
+ continue;
name = var_opt_val[i]
print " hstate.add_wide_int (ptr->" name");";
}
var_opt_char[2] = "unsigned char x_optimize_debug";
for (i = 0; i < n_opts; i++) {
- if (flag_set_p("Optimization", flags[i])) {
+ if (flag_set_p("(Optimization|PerFunction)", flags[i])) {
name = var_name(flags[i])
if(name == "")
continue;