usage of unoptimized builtins.
*/
#include <stdint.h>
-
#include "deflate.h"
#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
-# if defined(HAVE_BUILTIN_CTZL)
+
+ /* Only use std3_longest_match for little_endian systems, also avoid using it with
+ non-gcc compilers since the __builtin_ctzl() function might not be optimized. */
+# if defined(__GNUC__) && defined(HAVE_BUILTIN_CTZL) && ((__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || defined(__LITTLE_ENDIAN__))
# define std3_longest_match
# else
# define std2_longest_match
# endif
+
#else
# define std1_longest_match
#endif
+
#ifdef std1_longest_match
/*