[Bug middle-end/78786] GCC hangs/out of memory calling sprintf with large precision
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Dec 14 21:59:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78786
--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Wed Dec 14 21:58:19 2016
New Revision: 243672
URL: https://gcc.gnu.org/viewcvs?rev=243672&root=gcc&view=rev
Log:
PR middle-end/78786 - GCC hangs/out of memory calling sprintf with large
precision
gcc/ChangeLog:
PR middle-end/78786
* gimple-ssa-sprintf.c (target_dir_max): New macro.
(get_mpfr_format_length): New function.
(format_integer): Use HOST_WIDE_INT instead of int.
(format_floating_max): Same.
(format_floating): Call get_mpfr_format_length.
(format_directive): Use target_dir_max.
gcc/testsuite/ChangeLog:
PR middle-end/78786
* gcc.dg/tree-ssa/builtin-sprintf-warn-7.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-7.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple-ssa-sprintf.c
trunk/gcc/testsuite/ChangeLog
More information about the Gcc-bugs
mailing list