This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/23286] missed fully redundant expression
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Aug 2005 18:42:35 -0000
- Subject: [Bug tree-optimization/23286] missed fully redundant expression
- References: <20050808174631.23286.bonzini@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-08 18:42 -------
Confirmed, for some reason the following is caught though:
unsigned short f(unsigned short a)
{
unsigned short b = a <<1;
if (a & 0x8000)
a <<= 1, a = a ^ 0x1021;
else
a = b;
return a;
}
as a<<1 is caught being redundant. FRE catches the above on the mainline.
Hmm there is only one VH for the expression:
Created value VH.0 for a_2
Created value VH.1 for (short int) VH.0
Created value VH.2 for VH.0 << 1
Created value VH.3 for VH.2 ^ 4129
Created value VH.4 for a_1
Created value VH.5 for (int) VH.4
Created value VH.6 for <retval>_5
exp_gen[-1] := { }
tmp_gen[-1] := { a_2 (VH.0) }
avail_out[-1] := { a_2 (VH.0) }
exp_gen[0] := { a_2 (VH.0) , (short int) VH.0 (VH.1) }
tmp_gen[0] := { a.0_3 (VH.1) }
avail_out[0] := { a_2 (VH.0) , a.0_3 (VH.1) }
exp_gen[1] := { a_2 (VH.0) , VH.0 << 1 (VH.2) , VH.2 ^ 4129 (VH.3) }
tmp_gen[1] := { a_7 (VH.2) , a_8 (VH.3) }
avail_out[1] := { a_2 (VH.0) , a.0_3 (VH.1) , a_7 (VH.2) , a_8 (VH.3) }
exp_gen[2] := { a_2 (VH.0) , VH.0 << 1 (VH.2) }
tmp_gen[2] := { a_6 (VH.2) }
avail_out[2] := { a_2 (VH.0) , a.0_3 (VH.1) , a_6 (VH.2) }
exp_gen[3] := { a_1 (VH.4) , (int) VH.4 (VH.5) }
tmp_gen[3] := { D.1280_4 (VH.5) , <retval>_5 (VH.6) }
avail_out[3] := { a_1 (VH.4) , a_2 (VH.0) , a.0_3 (VH.1) , D.1280_4 (VH.5) , <retval>_5 (VH.6) }
exp_gen[-2] := { }
tmp_gen[-2] := { }
avail_out[-2] := { }
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |dberlin at gcc dot gnu dot
| |org
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-08-08 18:42:33
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23286