When the attached file is compiled with a mingw32 build of GCC 4.2.0 using the -O2 option (gcc -O2 -c timestamp2.i), lines 159 and 160 are never executed when running the program that uses this file. Since the hashitem function modifies the variable b which is passed to it by-address, leaving those statements out is definitely not a valid optimization. Compiling without -O2 (gcc -c timestamp2.i) gives the correct result. Sorry I can't read assembler, or I'd try to narrow things down more.
This is a regression from 4.1.2, which works correctly with or without -O2. If it helps, the GCC binaries I use (and sources) can be downloaded at http://hosted.filefront.com/tldragon7. -- Summary: 4.2.0: -O2 causes skipped code Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tdragon at tdragon dot net GCC build triplet: i386-pc-mingw32 GCC host triplet: i386-pc-mingw32 GCC target triplet: i386-pc-mingw32 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32328