diff options
author | Martin Sebor <msebor@redhat.com> | 2017-01-26 21:14:18 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2017-01-26 14:14:18 -0700 |
commit | 5d93da1d112c93b38b6c68e3c51e20daefc01423 (patch) | |
tree | 8ffb711a698c635dac9a4bda3e672fa8a950f45e /gcc/dwarf2out.c | |
parent | c86996727f9c4ea4e2aed092d631a2cf99110c5d (diff) | |
download | gcc-5d93da1d112c93b38b6c68e3c51e20daefc01423.zip gcc-5d93da1d112c93b38b6c68e3c51e20daefc01423.tar.gz gcc-5d93da1d112c93b38b6c68e3c51e20daefc01423.tar.bz2 |
PR middle-end/78703 -fprintf-return-value floating point handling incorrect in locales with a mulltibyte decimal point
gcc/ChangeLog:
PR middle-end/78703
* gimple-ssa-sprintf.c (struct result_range): Add likely and
unlikely counters.
(struct format_result): Replace number_chars, number_chars_min,
and number_chars_max with a single member of struct result_range.
Remove bounded.
(format_result::operator+=): Adjust.
(struct fmtresult): Remove bounded. Handle likely and unlikely
counters.
(fmtresult::adjust_for_width_or_precision): New function.
(fmtresult:type_max_digits): New function.
(bytes_remaining): Handle likely and unlikely counters.
(min_bytes_remaining): Remove.
(format_percent): Simplify.
(format_integer, format_floating): Set likely and unlikely counters.
(get_string_length, format_character, format_string): Same.
(format_plain, should_warn_p): New function.
(maybe_warn): Call should_warn_p. Update diagnostic messages
and handle those for all directives, including plain strings.
(format_directive): Handle likely and unlikely counters.
Remove unnecessary quoting from diagnostics. Add an informational
note.
(add_bytes): Remove.
(pass_sprintf_length::compute_format_length): Simplify.
(try_substitute_return_value): Handle likely and unlikely counters.
gcc/testsuite/ChangeLog:
PR middle-end/78703
* gcc.dg/format/pr78569.c: Adjust.
* gcc.dg/tree-ssa/builtin-snprintf-warn-2.c: Same.
* gcc.dg/tree-ssa/builtin-sprintf-2.c: Same.
* gcc.dg/tree-ssa/builtin-sprintf-5.c: Same.
* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Same.
* gcc.dg/tree-ssa/builtin-sprintf-warn-2.c: Same.
* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Same.
* gcc.dg/tree-ssa/builtin-sprintf-warn-4.c: Same.
* gcc.dg/tree-ssa/builtin-sprintf-warn-6.c: Same.
* gcc.dg/tree-ssa/builtin-sprintf-warn-7.c: Same.
* gcc.dg/tree-ssa/builtin-sprintf-warn-9.c: Same.
* gcc.dg/tree-ssa/builtin-sprintf.c: Same.
From-SVN: r244953
Diffstat (limited to 'gcc/dwarf2out.c')
0 files changed, 0 insertions, 0 deletions