egcs combine.c:simplify_shift_const

Ian Lance Taylor ian@cygnus.com
Sat Jan 31 11:45:00 GMT 1998


   From: John Carr <jfc@mit.edu>
   Date: Fri, 30 Jan 1998 19:23:37 -0500

   This patch simplifies (lshiftrt (truncate (lshiftrt))) to
   (truncate (lshiftrt)).  This helps the multiply highpart
   patterns in the SPARC changes I am working on.

It seems to me that
    (lshiftrt:HI (truncate:HI (lshifrt:SI (reg:SI 0) 8)) 8)
is not identical to
    (truncate:HI (lshiftrt:SI (reg:SI 0) 16))

If register 0 holds 0x12345678, the first expression evaluates to
0x34, and the second evaluates to 0x1234.

What am I missing?

Ian



More information about the Gcc mailing list