This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/15757] Convert "If (a >= b) X else if (b <= a) Y" into "if (a >= b) X".
- From: "law at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jun 2004 20:22:21 -0000
- Subject: [Bug tree-optimization/15757] Convert "If (a >= b) X else if (b <= a) Y" into "if (a >= b) X".
- References: <20040601081718.15757.kazu@cs.umass.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From law at redhat dot com 2004-06-05 20:22 -------
Subject: Re: Convert "If (a >= b) X else if
(b <= a) Y" into "if (a >= b) X".
On Tue, 2004-06-01 at 05:20, pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-01 11:20 -------
> Confirmed.
>
> Hmm, looks like jump threading needs a little improvement.
No. More correctly, we do not canonicalize equivalent expressions.
What we're looking at is canonicalizing commutative operators and
conditionals so that given two SSA_NAMEs as operands, they will
be automatically ordered such that the lowest SSA_NAME_VERSION
appears first. Given an SSA_NAME and a constant, the SSA_NAME
should come first.
A prototype of this (of course) fixes this problem. I'm still
evaluating that prototype.
jeff
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15757