aboutsummaryrefslogtreecommitdiff
path: root/gcc/common.opt
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2017-01-07 19:53:13 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2017-01-07 19:53:13 +0000
commitff98fa955b5dc98bb05e30ed79299155d2a2f97c (patch)
tree2bf26f2a4e197b339a06e6fa3464a559f3ddd2e8 /gcc/common.opt
parent42002dfec374c429569796c275001f1b0635e674 (diff)
downloadgcc-ff98fa955b5dc98bb05e30ed79299155d2a2f97c.zip
gcc-ff98fa955b5dc98bb05e30ed79299155d2a2f97c.tar.gz
gcc-ff98fa955b5dc98bb05e30ed79299155d2a2f97c.tar.bz2
[-fcompare-debug] var tracking options are not optimization options
If we include them in the ICF hash, they may cause congruence_groups to be processed in a different order due to different hashes, which in turn causes different funcdef_nos to be assigned to functions. Since these numbers are included in -fcompare-debug dumps, they cause failures. Since these options are not optimization options, in that they do not (or should not, save for bugs like this) affect the executable code output by the compiler, they should not be marked as such. This patch replaces the Optimization flag in the var-tracking options with the newly-introduced PerFunction flag, so that it can still be controlled on a per-function basis, but that disregards it in the hash computation used by ICF. This fixes -fcompare-debug failures in numerous LTO testcases. for gcc/ChangeLog * 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. From-SVN: r244198
Diffstat (limited to 'gcc/common.opt')
-rw-r--r--gcc/common.opt8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/common.opt b/gcc/common.opt
index a18e27d..4b35e4b 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2644,7 +2644,7 @@ Common Undocumented Var(flag_use_linker_plugin)
; 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
@@ -2652,13 +2652,13 @@ Perform variable tracking.
; 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
@@ -2666,7 +2666,7 @@ Toggle -fvar-tracking-assignments.
; 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