This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/86274] [7/8/9 Regression] SEGFAULT when logging std::to_string(NAN)


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]