I noticed this while developing/debugging the source file, the code is in a very rough and buggy state but the behavior I'm getting seems to be tied to a properly formed printf().
$ gcc -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu Thread model: posix gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5) File will be attached. Sample output: WITH THE PRINTF (note the "Most common" lines): Current: 1 Most common: 1 9 :: 1 Current: 1 Current: 19 Most common: 4 15 :: 19 Current: 1 Current: 1 Current: 1 Current: 1 Current: 20 Most common: c 1c :: 20 Current: 1 Current: 1 Current: 1 Current: 1 Current: 1 Current: 68 Most common: 11 11 :: 68 Current: 1 Current: 1 Current: 77 Most common: 11 19 :: 77 Current: 5 Current: 1 Current: 4 Current: 1 Current: 4 Current: 11 Current: 5 Current: 7 Current: 2 Current: 6 Current: 1 Current: 3 Current: 16 Current: 7 Current: 1 Current: 19 Current: 4 Current: 8 Current: 6 Current: 8 Current: 9 Current: 8 [output trimmed...] Most common: 11 19 :: 77 0 0 :: 516 Key size: 134513244 WITHOUT THE PRINTF ("Current: %i\n" lines no longer printing): Most common: 0 0 :: 0 0 0 :: 516 Key size: 134513244 -- Summary: gcc miscompilation of some stuff Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: nigelenki at comcast dot net GCC host triplet: i486-linux-gnu GCC target triplet: i486-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29595