------- Comment #26 from ubizjak at gmail dot com 2008-02-10 08:23 ------- Following is significantly minimized testcase:
--cut here-- #include <stdlib.h> #include <stdio.h> struct real_value { unsigned long sig[3]; }; #ifdef INLINE static inline void __attribute__((always_inline)) #else static void __attribute__((noinline)) #endif normalize (struct real_value *r) { int j; for (j = 0; ; j++) if (r->sig[2] & ((unsigned long)1 << (63 - j))) break; printf ("%i\n", j); if (j) abort (); } static void __attribute__((noinline)) do_test (struct real_value *r) { int i; for (i = 0; i < 2; ++i) normalize (r); } int main() { struct real_value r; r.sig[0] = 0ull; r.sig[1] = 0ull; r.sig[2] = 0x8000000000000001ull; do_test (&r); return 0; } --cut here-- [EMAIL PROTECTED] test]$ gcc -O2 -DINLINE t1.c [EMAIL PROTECTED] test]$ ./a.out 63 Aborted [EMAIL PROTECTED] test]$ gcc -O2 t1.c [EMAIL PROTECTED] test]$ ./a.out 0 0 Note, that it looks like MSB is not detected in normalize(). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33992