This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] UNKNOWN comparison codes don't match
- To: gcc-patches at gcc dot gnu dot org
- Subject: [PATCH] UNKNOWN comparison codes don't match
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Mon, 15 Jan 2001 00:35:59 +0100
Hi,
compiling glibc-2.2.1 with current CVS on powerpc-linux-gnu produced broken
code with this testcase:
extern void exit (int);
extern void abort (void);
float
rintf (float x)
{
static const float TWO23 = 8388608.0;
if (__builtin_fabs (x) < TWO23)
{
if (x > 0.0)
{
x += TWO23;
x -= TWO23;
}
else if (x < 0.0)
{
x = TWO23 - x;
x = -(x - TWO23);
}
}
return x;
}
int main (void)
{
if (rintf (-1.5) != -2.0)
abort ();
exit (0);
}
The attached patch fixes that, bootstrapped and tested OK.
OK to commit patch & testcase?
Franz.
* jump.c (comparison_dominates_p): Don't try to handle UNKNOWN
comparison codes.
Index: gcc/jump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/jump.c,v
retrieving revision 1.151
diff -u -p -r1.151 jump.c
--- gcc/jump.c 2001/01/08 18:52:50 1.151
+++ gcc/jump.c 2001/01/14 23:27:05
@@ -2087,6 +2087,9 @@ int
comparison_dominates_p (code1, code2)
enum rtx_code code1, code2;
{
+ if (code1 == UNKNOWN || code2 == UNKNOWN)
+ return 0;
+
if (code1 == code2)
return 1;