aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@gotplt.org>2024-07-25 19:30:38 -0400
committerThomas Koenig <tkoenig@gcc.gnu.org>2024-07-28 19:06:01 +0200
commite21f9f6054e16bc2d7cd3bc0226f53a758d92fe0 (patch)
tree34910c760d076116c4abfe8ab1bae0c1a7405fe2 /gcc
parent9699dc4b4292a634e18fad2f323dcd34c292171b (diff)
downloadgcc-e21f9f6054e16bc2d7cd3bc0226f53a758d92fe0.zip
gcc-e21f9f6054e16bc2d7cd3bc0226f53a758d92fe0.tar.gz
gcc-e21f9f6054e16bc2d7cd3bc0226f53a758d92fe0.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>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gimple-ssa-sprintf.cc2
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. */