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: "dberlin 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:56:31 -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 dberlin at gcc dot gnu dot org 2005-08-08 18:56 -------
(In reply to comment #1)
> Confirmed, for some reason the following is caught though:
If you thought about it, you'd notice that your example below has two
computations of a = b along the if branch, which is not optimal.
The original has one computation on each path which is already optimal.
> unsigned short f(unsigned short a)
> {
> unsigned short b = a <<1;
> if (a & 0x8000)
> a <<= 1, a = a ^ 0x1021;
> else
> a = b;
>
> return a;
> }
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23286