about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--iconv/loop.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/iconv/loop.c b/iconv/loop.c
index 062cc1b868..560a5f6394 100644
--- a/iconv/loop.c
+++ b/iconv/loop.c
@@ -436,6 +436,12 @@ SINGLE(LOOPFCT) (struct __gconv_step *step,
     return __GCONV_FULL_OUTPUT;
 
   /*  Now add characters from the normal input buffer.  */
+  if (inlen >= MAX_NEEDED_INPUT)
+    /* Avoid a -Wstringop-overflow= warning when this loop is
+       unrolled.  The compiler cannot otherwise see that this is
+       unreachable because it depends on (state->__count & 7) not
+       being too large after a previous conversion step.  */
+    __builtin_unreachable ();
   do
     bytebuf[inlen++] = *inptr++;
   while (inlen < MAX_NEEDED_INPUT && inptr < inend);