Hello.

This enables doable LTO bootstrap w/o -disable-werror. First change is mentioned
in the PR, second is adding -fno-lto to libdecnumber. Honza told me that proper
fix would take more effort as it's an old library. Last needed hunk handles 
-Wmaybe-uninitialized,
as described in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79003#c4.

Patch LTO bootstraps on x86_64-linux-gnu, can bootstrap on ppc64le-redhat-linux
and survives regression tests.

Ready to be installed?
Martin
>From 67a3ccd99963ac19cbaebf17453cb51819c7bf1d Mon Sep 17 00:00:00 2001
From: marxin <mli...@suse.cz>
Date: Thu, 5 Jan 2017 17:18:27 +0100
Subject: [PATCH] Fix lto-bootstrap (PR bootstrap/79003).

gcc/ChangeLog:

2017-01-05  Martin Liska  <mli...@suse.cz>

	PR bootstrap/79003
	* lra-constraints.c: Rename invariant to lra_invariant.
	* predict.c (set_even_probabilities): Initialize e to NULL.

libdecnumber/ChangeLog:

2017-01-05  Martin Liska  <mli...@suse.cz>

	PR bootstrap/79003
	* Makefile.in: Add -fno-lto to {C,CPP,LD}FLAGS.
---
 gcc/lra-constraints.c    | 9 +++++----
 gcc/predict.c            | 2 +-
 libdecnumber/Makefile.in | 6 +++---
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index 61991280373..5ada67a36ba 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -4749,7 +4749,7 @@ lra_constraints_finish (void)
 
 
 /* Structure describes invariants for ineheritance.  */
-struct invariant
+struct lra_invariant
 {
   /* The order number of the invariant.  */
   int num;
@@ -4759,7 +4759,7 @@ struct invariant
   rtx_insn *insn;
 };
 
-typedef struct invariant invariant_t;
+typedef lra_invariant invariant_t;
 typedef invariant_t *invariant_ptr_t;
 typedef const invariant_t *const_invariant_ptr_t;
 
@@ -4767,7 +4767,7 @@ typedef const invariant_t *const_invariant_ptr_t;
 static vec<invariant_ptr_t> invariants;
 
 /* Allocation pool for the invariants.  */
-static object_allocator<struct invariant> *invariants_pool;
+static object_allocator<lra_invariant> *invariants_pool;
 
 /* Hash table for the invariants.  */
 static htab_t invariant_table;
@@ -4817,7 +4817,8 @@ static void
 initiate_invariants (void)
 {
   invariants.create (100);
-  invariants_pool = new object_allocator<struct invariant> ("Inheritance invariants");
+  invariants_pool
+    = new object_allocator<lra_invariant> ("Inheritance invariants");
   invariant_table = htab_create (100, invariant_hash, invariant_eq_p, NULL);
 }
 
diff --git a/gcc/predict.c b/gcc/predict.c
index e85573bc51d..f851e14b4ed 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -795,7 +795,7 @@ set_even_probabilities (basic_block bb,
 			hash_set<edge> *unlikely_edges = NULL)
 {
   unsigned nedges = 0;
-  edge e;
+  edge e = NULL;
   edge_iterator ei;
 
   FOR_EACH_EDGE (e, ei, bb->succs)
diff --git a/libdecnumber/Makefile.in b/libdecnumber/Makefile.in
index 02c327a59c4..2cfc5f48720 100644
--- a/libdecnumber/Makefile.in
+++ b/libdecnumber/Makefile.in
@@ -31,13 +31,13 @@ ACLOCAL = @ACLOCAL@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 CC = @CC@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -fno-lto
 WARN_CFLAGS = @WARN_CFLAGS@ @WARN_PEDANTIC@ @WERROR@
 CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
+CPPFLAGS = @CPPFLAGS@ -fno-lto
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
-LDFLAGS = @LDFLAGS@
+LDFLAGS = @LDFLAGS@ -fno-lto
 LIBICONV = @LIBICONV@
 PACKAGE = @PACKAGE@
 PICFLAG = @PICFLAG@
-- 
2.11.0

Reply via email to