Commit ac4cdf40 by Jason Eckhardt Committed by Jason Eckhardt

combine.c (known_cond): Do not reverse the condition when SMAX/UMAX is being considered and the...

        * combine.c (known_cond): Do not reverse the condition when
        SMAX/UMAX is being considered and the condition is for equality
        or inequality.

        * testsuite/gcc.c-torture/execute/20010221-1.c: New test.

From-SVN: r40077
parent 6a163d7c
2001-02-26 Jason Eckhardt <jle@redhat.com>
* combine.c (known_cond): Do not reverse the condition when
SMAX/UMAX is being considered and the condition is for equality
or inequality.
* testsuite/gcc.c-torture/execute/20010221-1.c: New test.
2001-02-26 Philip Blundell <philb@gnu.org>
* config.gcc: Remove obsolete targets "arm*-*-linuxoldld" and
......
......@@ -7512,7 +7512,12 @@ known_cond (x, cond, reg, val)
{
int unsignedp = (code == UMIN || code == UMAX);
if (code == SMAX || code == UMAX)
/* Do not reverse the condition when it is NE or EQ.
This is because we cannot conclude anything about
the value of 'SMAX (x, y)' when x is not equal to y,
but we can when x equals y. */
if ((code == SMAX || code == UMAX)
&& ! (cond == EQ || cond == NE))
cond = reverse_condition (cond);
switch (cond)
......
int n = 2;
main ()
{
int i, x = 45;
for (i = 0; i < n; i++)
{
if (i != 0)
x = ( i > 0 ) ? i : 0;
}
if (x != 1)
abort ();
exit (0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment