This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/86274] [7/8/9 Regression] SEGFAULT when logging std::to_string(NAN)
- 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: Mon, 02 Jul 2018 15:41:36 +0000
- Subject: [Bug tree-optimization/86274] [7/8/9 Regression] SEGFAULT when logging std::to_string(NAN)
- Auto-submitted: auto-generated
- References: <bug-86274-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86274
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org
--- Comment #13 from Martin Sebor <msebor at gcc dot gnu.org> ---
The sprintf pass doesn't consider NaNs and infinities. The output for the
-fdump-tree-printf-return-value option shows:
;; Function main (main, funcdef_no=0, decl_uid=1898, cgraph_uid=1,
symbol_order=1) (executed once)
__builtin_snprintf: objsize = 220, fmtstr = "%f"
Directive 1 at offset 0: "%f"
Result: 8, 8, 317, 322 (8, 8, 317, 322)
Directive 2 at offset 2: "", length = 1
Setting potentially out-of-bounds return value range [8, 322].
The range should be [3, 322]. Let me handle it.