diff options
author | Siddhesh Poyarekar <siddhesh@gotplt.org> | 2024-07-25 19:30:38 -0400 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@gotplt.org> | 2024-07-26 13:34:11 -0400 |
commit | 6fe1e1fad120350b9a392a7afb728d8418e79110 (patch) | |
tree | d90e3715858e4c9f952f90c4af7bc736cdd4f3f8 | |
parent | 795021d9bc8546ccc51bacc899b6077c6928067b (diff) | |
download | gcc-6fe1e1fad120350b9a392a7afb728d8418e79110.zip gcc-6fe1e1fad120350b9a392a7afb728d8418e79110.tar.gz gcc-6fe1e1fad120350b9a392a7afb728d8418e79110.tar.bz2 |
gimple-ssa-sprintf: Fix typo in range check
The code to scale ranges for wide chars in format_string incorrectly
checks range.likely to scale range.unlikely, which is a copy-paste typo
from the immediate previous condition.
gcc/ChangeLog:
* gimple-ssa-sprintf.cc (format_string): Fix type in range check
for UNLIKELY for wide chars.
Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
-rw-r--r-- | gcc/gimple-ssa-sprintf.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/gimple-ssa-sprintf.cc b/gcc/gimple-ssa-sprintf.cc index 025b0fb..0900710 100644 --- a/gcc/gimple-ssa-sprintf.cc +++ b/gcc/gimple-ssa-sprintf.cc @@ -2623,7 +2623,7 @@ format_string (const directive &dir, tree arg, pointer_query &ptr_qry) if (slen.range.likely < target_int_max ()) slen.range.likely *= 2; - if (slen.range.likely < target_int_max ()) + if (slen.range.unlikely < target_int_max ()) slen.range.unlikely *= target_mb_len_max (); /* A non-empty wide character conversion may fail. */ |