http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49799
Carrot <carrot at google dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|target |rtl-optimization --- Comment #4 from Carrot <carrot at google dot com> 2011-07-25 08:39:27 UTC --- After some combine, gcc gets the following expression (ashiftrt:SI (ashift:SI (reg:SI 145 [ *K_2(D) ]) (const_int -1 [0xffffffffffffffff])) (const_int 16 [0x10])) Then gcc tries to simplify it by calling make_compound_operation, in this function at line 7786, it detects the cases that shift left and right and replaces it with bit field extraction. It is a good optimization for usual cases. But for this ill formed case, we can't make a valid bit field extraction since we don't know what's the target field. Add the following condition for the transformation should prevent the illegal instruction. INTVAL (XEXP (lhs, 1)) >= 0