summaryrefslogtreecommitdiff
path: root/gcc/opt-functions.awk
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2016-12-31 07:46:01 -0200
committerAlexandre Oliva <aoliva@redhat.com>2017-01-06 01:31:00 -0200
commit172df0c0ad97307f3d28b9a070c341a74dad233a (patch)
tree9a25a24357e94d8f12fa7ca3a31013c977341209 /gcc/opt-functions.awk
parent2dccc7c49bef10d058260151cef37bababc47d20 (diff)
downloadgcc-172df0c0ad97307f3d28b9a070c341a74dad233a.tar.gz
[-fcompare-debug] var tracking options are not optimization optionsaoliva/non-SFN-fixes-for-GCC7
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.
Diffstat (limited to 'gcc/opt-functions.awk')
-rw-r--r--gcc/opt-functions.awk2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk
index 7cf50256558..a4aeeda2474 100644
--- a/gcc/opt-functions.awk
+++ b/gcc/opt-functions.awk
@@ -105,7 +105,7 @@ function switch_flags (flags)
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
}