http://gcc.gnu.org/ml/gcc-bugs/2003-07/msg00468.html What version of gcc are you trying it on? With 3.3.1 (20030616), I get the optimization you recommend but with 3.2.3, I do not get this optimization. Try 3.3 and then report back if it is fixed. Thanks, Andrew Pinski