This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/77753] [7 Regression] broken profiledbootstrap due to -Werror=format-length in varasm.c:1573
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 27 Sep 2016 18:22:22 +0000
- Subject: [Bug bootstrap/77753] [7 Regression] broken profiledbootstrap due to -Werror=format-length in varasm.c:1573
- Auto-submitted: auto-generated
- References: <bug-77753-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77753
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2016-09-27
Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
The precision in integer directives "...gives the minimum number of digits to
appear for the d, i, o, u, x, and X conversion specifiers..." so the warning
seems justified to me (in as much as the warning pass can see). The buffer
size should be increased to 18 bytes to avoid the potential overflow when the
magnitude of (MAX_INIT_PRIORITY - priority) approaches INT_MAX.
Alternatively, if the priority is in some subrange of [INT_MIN, INT_MAX] it
could be constrained so that the gimple-ssa-sprintf pass can see it (e.g., by
changing the argument type or casting it to a type with a smaller precision).
This may or may not work depending on whether the range information for the
expression is available (the pass does make use of VRP results but they are
often bogus).
It's usually simpler and safer to increase the size of the buffer so unless
there's some concern with it I'll post a patch to do that.