This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/13191] Redundant sign extends


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]