The attached one line patch increases a local buffer size to
avoid an apparently justified (though in reality likely a false
positive) -Wformat-length warning in varasm.c.  The warning has
been reported to break profiledbootstrap on powerp64le (though
not ordinary bootstrap).

An arguably better solution would be to explicitly constrain
the range of the integer variable to that of valid priority values.
Unfortunately, as pointed out in bug 77721, due to the limitation
of the current VRP implementation, this isn't always reliable.

Martin
PR bootstrap/77753 - [7 Regression] broken profiledbootstrap due to
	-Werror=format-length in varasm.c:1573

gcc/ChangeLog:
2016-09-27  Martin Sebor  <mse...@redhat.com>

	PR bootstrap/77753
	* varasm.c (assemble_addr_to_section): Increase local buffer size.

Index: gcc/varasm.c
===================================================================
--- gcc/varasm.c	(revision 240556)
+++ gcc/varasm.c	(working copy)
@@ -1556,7 +1556,9 @@ assemble_addr_to_section (rtx symbol, se
 section *
 get_cdtor_priority_section (int priority, bool constructor_p)
 {
-  char buf[16];
+  /* Buffer conservatively large enough for the full range of a 32-bit
+     int plus the text below.  */
+  char buf[18];
 
   /* ??? This only works reliably with the GNU linker.  */
   sprintf (buf, "%s.%.5u",

Reply via email to