-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 03/08/11 03:48, sankar chebolu wrote: > foo (char *x) > { > char ret = *x; > > if (x) > com(); > else > bar(); > return ret; > } > GCC 4.1 is insanely old and the optimizer may not have been working for some reason. We don't really work on GCC 4.1 anymore. Compiling your testcase with -O2 using GCC 4.5.1 I get: .globl foo .type foo, @function foo: .LFB0: .cfi_startproc pushq %rbx .cfi_def_cfa_offset 16 .cfi_offset 3, -16 movsbl (%rdi), %ebx xorl %eax, %eax call com movl %ebx, %eax popq %rbx .cfi_def_cfa_offset 8 ret .cfi_endproc .LFE0: Clearly the null pointer check was eliminated. jeff -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJNdj0DAAoJEBRtltQi2kC7p5AH/33tN/amBk2yAIw1J6sxwvQP 1R1ckU3Q9Je5xt9QbRG7N3oooiiC+TE6SbeHmPSFSiJcyY86AkJmotlhzVx65dF1 jiYDsbTkIQsCHT1KofKm5QcAGFZdMUEafwt0hzlewRH6ZIc0cNogZGvg99OWTuPY 7izhSEXKRPxkhvnYJdxb7Wk3cPzt89V1xJzVZ8lJJek7HvjrDLq9EzYtkvHeBmN8 zV4rl4Sp0iIslQV3Y5gEDNJH+84GpZ8sNLRPoCNn+O7RRx+LWEzfc3oh+mddgFx/ G7Tk04SULkFLNK9fAdz3o5Oa+OtnZRvPiFyfS6qSWcHulRgm13hPNGwtQd17EKA= =blOC -----END PGP SIGNATURE-----