http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46027
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-10-19 00:29:18 UTC --- Here is a full testcase: typedef unsigned type1; typedef unsigned char type2; type1 t; void f(type1 tt) { type2 t1 = t; type1 t2 = t1; t = t2 & 0xFF; } void f2(type1 tt) { type1 t2 = (type2)t; t = t2 & 0xFF; } void f1(type1 tt) { type1 t2 = t & 0xff; t = t2 & 0xFF; } ---- CUT ---- Currently f does not get optimized after my patch. f1 is optimized before my patch and f2 is optimized afterwards. f requires some kind of forward prop/tree combining to do the work.