[Bug middle-end/13191] Redundant sign extends
falk at debian dot org
gcc-bugzilla@gcc.gnu.org
Wed Nov 26 00:11:00 GMT 2003
------- Additional Comments From falk at debian dot org 2003-11-26 00:11 -------
I'm seeing this too on Alpha. Another real-world example:
int parity (unsigned x)
{
x ^= x >> 16;
x ^= x >> 8;
x ^= x >> 4;
x &= 0xf;
return (0x6996 >> x) & 1;
}
contains two pointless zero-extensions when compiled on Alpha.
I'm not sure how to approach this; there are powerful general purpose zero/sign
extension elimination algorithms
(http://www.trl.ibm.com/projects/jit/paper/sxt.pdf), but probably a few
more well-placed ad hoc rules would suffice.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13191
More information about the Gcc-bugs
mailing list