On 07/20/2011 09:41 AM, Uros Bizjak wrote: > * config/i386/i386.c (ix86_decompose_address): Also allow promoted > paradoxical subregs in base and PLUS chains. Allow only paradoxical > subregs and subregs of DImode hard registers in subregs of index. > (ix86_legitimate_address_p): Allow subregs of base and index to span > more than a word. Assert that subregs of base and index satisfy > SUBREG_PROMOTED_UNSIGNED_P or register_no_elim_operand predicates.
The patch looks good. It seems like one other check is required: that the mode of base and index are the same. We've been accepting either SImode or DImode. As long as they're both the same we get either mov (%rax, %rdx, 4), %ebx mov (%eax, %edx, 4), %ebx which are both valid insns (without and with addr32 prefix). Whereas mov (%rax, %edx, 4), %ebx will correctly be rejected by the assembler. r~