On 12/01/2015 12:32 PM, Richard Sandiford wrote:
Jeff Law <l...@redhat.com> writes:
@@ -1080,6 +1070,18 @@ add_removable_extension (const_rtx expr, rtx_insn *insn,
}
}
+ /* Fourth, if the extended version occupies more registers than the
+ original and the source of the extension is the same hard register
+ as the destination of the extension, then we can not eliminate
+ the extension without deep analysis, so just punt.
+
+ We allow this when the registers are different because the
+ code in combine_reaching_defs will handle that case correctly. */
+ if ((HARD_REGNO_NREGS (REGNO (dest), mode)
+ != HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg)))
+ && REGNO (dest) == REGNO (reg))
+ return;
+
/* Then add the candidate to the list and insert the reaching
definitions
into the definition map. */
ext_cand e = {expr, code, mode, insn};
I might be wrong, but the check looks specific to little-endian. Would
it make sense to use reg_overlap_mentioned_p instead of the REGNO check?
Agreed. Testing in progress now...
jeff