http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49618
Eugene Rudoy <ernews at gmx dot de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ernews at gmx dot de --- Comment #7 from Eugene Rudoy <ernews at gmx dot de> 2011-07-03 20:09:42 UTC --- (In reply to comment #4) > With the Patch from [1] I could boot a firmware-image on my router. It seems the "if-conversion"-opt is not the actual reason. It does solve the issue, but it's not the reason. Explanation: "if-conversion" is enabled by default at -O1. The code is however not miss-compiled when compiled using -O1 (-Os causes it to be miss-compiled). I found out that disabling gcse and cse-follow-jumps (i.e. passing -fno-gcse -fno-cse-follow-jumps [1]) also solves the issue. As the optimization level (-O2/-Os) these both are by default enabled on correspond to the -Os flag we use I consider them to be the actual reason for the miss-compiling. [1] http://freetz.org/attachment/ticket/1310/gcc-4.6.x-disable-opt-flags.patch