[Bug c++/45221] missed optimization with multiple bases and casting

navin dot kumar at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Aug 7 15:26:00 GMT 2010



------- Comment #5 from navin dot kumar at gmail dot com  2010-08-07 15:25 -------
Hi Richard,

Your explanation doesn't explain why foo1 would emit poorer assembly than foo3.

Or for that matter why fooA would emit poorer assembly than fooB.

In the case of foo1, foo3, fooA, and fooB, dereferencing occurs first, before
casting.  Yet only foo3 and fooB generate optimal assembly (so gcc is clearly
"capable" of outputting the desired asm).  This is all at -O3, where
"-fdelete-null-pointer-checks" is already enabled.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45221



More information about the Gcc-bugs mailing list