about summary refs log tree commit diff
path: root/iconvdata/8bit-gap.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconvdata/8bit-gap.c')
-rw-r--r--iconvdata/8bit-gap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/iconvdata/8bit-gap.c b/iconvdata/8bit-gap.c
index c805d5e57c..75493f758f 100644
--- a/iconvdata/8bit-gap.c
+++ b/iconvdata/8bit-gap.c
@@ -48,7 +48,7 @@ struct gap
   {									      \
     uint32_t ch = to_ucs4[*inptr];					      \
 									      \
-    if (HAS_HOLES && ch == L'\0' && *inptr != '\0')			      \
+    if (HAS_HOLES && __builtin_expect (ch, L'\1') == L'\0' && *inptr != '\0') \
       {									      \
 	/* This is an illegal character.  */				      \
 	if (! ignore_errors_p ())					      \
@@ -80,7 +80,7 @@ struct gap
     uint32_t ch = get32 (inptr);					      \
     unsigned char res;							      \
 									      \
-    if (ch >= 0xffff)							      \
+    if (__builtin_expect (ch, 0) >= 0xffff)				      \
       {									      \
 	/* This is an illegal character.  */				      \
 	if (! ignore_errors_p ())					      \
@@ -95,7 +95,7 @@ struct gap
       }									      \
     while (ch > rp->end)						      \
       ++rp;								      \
-    if (ch < rp->start)							      \
+    if (__builtin_expect (ch < rp->start, 0))				      \
       {									      \
 	/* This is an illegal character.  */				      \
 	if (! ignore_errors_p ())					      \
@@ -110,7 +110,7 @@ struct gap
       }									      \
 									      \
     res = from_ucs4[ch + rp->idx];					      \
-    if (ch != 0 && res == '\0')						      \
+    if (__builtin_expect (res, '\1') == '\0' && ch != 0)		      \
       {									      \
 	/* This is an illegal character.  */				      \
 	if (! ignore_errors_p ())					      \