[Bug rtl-optimization/45434] x86 missed optimization: use high register (ah, bh, ch, dh) when available to make comparisons
ubizjak at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Aug 29 16:40:00 GMT 2010
------- Comment #2 from ubizjak at gmail dot com 2010-08-29 16:40 -------
A bit simpler testcase:
int test(int i)
{
return (i & 0xFF) == ((i & 0xFF00) >> 8);
}
fails two combine attempts:
Trying 8 -> 9:
Failed to match this instruction:
(set (reg:CCZ 17 flags)
(compare:CCZ (zero_extract:SI (subreg:DI (reg/v:SI 63 [ i ]) 0)
(const_int 8 [0x8])
(const_int 8 [0x8]))
(reg:SI 65)))
Trying 8, 6 -> 9:
Failed to match this instruction:
(set (reg:CCZ 17 flags)
(compare:CCZ (subreg:QI (lshiftrt:SI (reg/v:SI 63 [ i ])
(const_int 8 [0x8])) 0)
(subreg:QI (reg/v:SI 63 [ i ]) 0)))
However, contrary to the first attempt, 8 -> 9 substitution in the second
attempt is over-optimized from ZERO_EXTRACT to LSHIFTRT. i386.md expects
ZERO_EXTRACT form.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45434
More information about the Gcc-bugs
mailing list