This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/13191] Redundant sign extends
- From: "falk at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Nov 2003 00:11:21 -0000
- Subject: [Bug middle-end/13191] Redundant sign extends
- References: <20031125235354.13191.amodra@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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