public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Re-use cc1-checksum.c for stage-final
@ 2016-04-28  8:50 Richard Biener
  2016-04-28 22:21 ` Jeff Law
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Biener @ 2016-04-28  8:50 UTC (permalink / raw)
  To: gcc-patches


The following prototype patch re-uses cc1-checksum.c from the
previous stage when compiling stage-final.  This eventually
allows to compare cc1 from the last two stages to fix the
lack of a true comparison when doing LTO bootstrap (it
compiles LTO bytecode from the compile-stage there, not the
final optimization result).

Bootstrapped on x86_64-unknown-linux-gnu.

When stripping gcc/cc1 and prev-gcc/cc1 after the bootstrap
they now compare identical (with LTO bootstrap it should
not require stripping as that doesn't do a bootstrap-debug AFAIK).

Is sth like this acceptable?  (consider it also done for cp/Make-lang.in)

In theory we can compare all stage1 languages but I guess comparing
the required ones for a LTO bootstrap, cc1, cc1plus and lto1 would
be sufficient (or even just comparing one binary in which case
comparing lto1 would not require any patches).

This also gets rid of the annoying warning that cc1-checksum.o
differs (obviously).

Thanks,
Richard.

2016-04-28  Richard Biener  <rguenther@suse.de>

	c/
	* Make-lang.in (cc1-checksum.c): For stage-final re-use
	the checksum from the previous stage.

Index: gcc/c/Make-lang.in
===================================================================
--- gcc/c/Make-lang.in	(revision 235499)
+++ gcc/c/Make-lang.in	(working copy)
@@ -63,9 +63,14 @@ c-warn = $(STRICT_WARN)
 # compute checksum over all object files and the options
 cc1-checksum.c : build/genchecksum$(build_exeext) checksum-options \
 	$(C_OBJS) $(BACKEND) $(LIBDEPS) 
-	build/genchecksum$(build_exeext) $(C_OBJS) $(BACKEND) $(LIBDEPS) \
+	if [ -f ../stage_final ] \
+	   && cmp -s ../stage_current ../stage_final; then \
+	  cp ../prev-gcc/cc1-checksum.c cc1-checksum.c; \
+	else \
+	  build/genchecksum$(build_exeext) $(C_OBJS) $(BACKEND) $(LIBDEPS) \
                      checksum-options > cc1-checksum.c.tmp && 		 \
-	$(srcdir)/../move-if-change cc1-checksum.c.tmp cc1-checksum.c
+	  $(srcdir)/../move-if-change cc1-checksum.c.tmp cc1-checksum.c; \
+	fi
 
 cc1$(exeext): $(C_OBJS) cc1-checksum.o $(BACKEND) $(LIBDEPS)
 	+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) \

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-05-18 22:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-28  8:50 [PATCH] Re-use cc1-checksum.c for stage-final Richard Biener
2016-04-28 22:21 ` Jeff Law
2016-04-29 11:36   ` Richard Biener
2016-05-02 15:56     ` Jeff Law
2016-05-03  8:18       ` Richard Biener
2016-05-03 10:32         ` Richard Biener
2016-05-18 22:01           ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).