Hello! Attached patch tightens the condition for TYPE_LEA instructions.
2015-01-26 Uros Bizjak <ubiz...@gmail.com> PR target/64795 * config/i386/i386.md (*movdi_internal): Also check operand 0 to determine TYPE_LEA operand. (*movsi_internal): Ditto. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Unfortunately, I was not able to construct a valid testcase, but the problem is fixed in an obvious way. Patch was committed to mainline, will be backported to release branches. Uros.
Index: config/i386/i386.md =================================================================== --- config/i386/i386.md (revision 220126) +++ config/i386/i386.md (working copy) @@ -2208,7 +2208,8 @@ (const_string "ssecvt") (eq_attr "alternative" "21,22,23,24") (const_string "mskmov") - (match_operand 1 "pic_32bit_operand") + (and (match_operand 0 "register_operand") + (match_operand 1 "pic_32bit_operand")) (const_string "lea") ] (const_string "imov"))) @@ -2361,7 +2362,8 @@ (const_string "ssemov") (eq_attr "alternative" "13,14") (const_string "mskmov") - (match_operand 1 "pic_32bit_operand") + (and (match_operand 0 "register_operand") + (match_operand 1 "pic_32bit_operand")) (const_string "lea") ] (const_string "imov")))