summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2017-11-15 03:11:37 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2017-11-15 03:11:37 +0000
commit3267bd36aaf32ac4c88e5a4618067d9141fbfac7 (patch)
tree5d4271af7bdbe2924a3d00fddbbe6990a298ced7 /config
parent3ca0dc603213b2ad5ffbcf1a443a102bef96053a (diff)
Use compare-debug for bootstrap-debug-lean to ignore != DW_AT_producer
Unlike bootstrap-debug, bootstrap-debug-lean used to pass compare using the traditional compare command, because it compiled both stage2 and stage3 with options that used to generate identical output (-fcompare-debug= in stage2 vs -fcompare-debug in stage3). Since we started adding relevant command-line flags to DW_AT_producer, this is no longer the case, and stages 2 and 3 object files that differ in nothing but the DW_AT_producer strings. -fcompare-debug is short for -fcompare-debug=-gtoggle, so stage3 compiles twice, once with the normal options, once with toggled -g, to then compare the temporary final dumps. When enabled, both compilations get from the driver an additional -frandom-seed flag (if none is given explicitly). -fcompare-debug= is short for -fno-compare-debug, disabling the second compilation. The difference between the DW_AT_producer lines are the different -fcompare-debug flags, and the presence of the -frandom-seed flag in the stage3 compilation. It is easy and sensible enough to filter the -fcompare-debug flags out of the DW_AT_producer string. This option should never affect the compilation output, it just determines whether or not to perform an additional compilation that should produce the same executable output. However, dropping -frandom-seed is not quite correct, in that it might have other consequences on the compilation. So, it makes little sense to make the effort to drop it when it's implicit; for those comparing compiler output differences, it might even hint at what causes, and could fix, difficult to explain differences, namely, explicitly supplying -frandom-seed options. They don't seem to matter for compiler bootstraps, though, at least for now, so we can safely refrain from issuing -frandom-seed (or maybe we already issue it where needed :-), and then, for bootstrap-debug-lean, use the compare-debug script, that strips out debug information before comparing the object files. for config/ChangeLog * bootstrap-debug-lean.mk (do-compare): Use the contrib/compare-debug script. for gcc/ChangeLog * dwarf2out.c (gen_producer_string): Discard OPT_fcompare_debug. From-SVN: r254750
Diffstat (limited to 'config')
-rw-r--r--config/ChangeLog5
-rw-r--r--config/bootstrap-debug-lean.mk1
2 files changed, 6 insertions, 0 deletions
diff --git a/config/ChangeLog b/config/ChangeLog
index 2e3ead0a26b..90e1af4779d 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,8 @@
+2017-11-15 Alexandre Oliva <aoliva@redhat.com>
+
+ * bootstrap-debug-lean.mk (do-compare): Use the
+ contrib/compare-debug script.
+
2017-10-24 H.J. Lu <hongjiu.lu@intel.com>
* bootstrap-cet.mk: New file.
diff --git a/config/bootstrap-debug-lean.mk b/config/bootstrap-debug-lean.mk
index e215280b09f..5f2db80687f 100644
--- a/config/bootstrap-debug-lean.mk
+++ b/config/bootstrap-debug-lean.mk
@@ -9,3 +9,4 @@
STAGE2_CFLAGS += -fcompare-debug=
STAGE3_CFLAGS += -fcompare-debug
+do-compare = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2