aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorJason Eckhardt <jle@redhat.com>2001-02-27 00:48:11 +0000
committerJason Eckhardt <jle@gcc.gnu.org>2001-02-27 00:48:11 +0000
commitac4cdf4033c6587c0cc361522d42b9732881b488 (patch)
tree5701f29dd30ba3424d394826ae84a75ec39ebb0d /gcc/combine.c
parent6a163d7cae1634d98c4c458725eb161adc7f946d (diff)
downloadgcc-ac4cdf4033c6587c0cc361522d42b9732881b488.zip
gcc-ac4cdf4033c6587c0cc361522d42b9732881b488.tar.gz
gcc-ac4cdf4033c6587c0cc361522d42b9732881b488.tar.bz2
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
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index b5735be..5dc26a8 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -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)