i386.c (ix86_expand_carry_flag_compare): Fix transformation of a>=0 into (unsigned)a<0x80000000.

* config/i386/i386.c (ix86_expand_carry_flag_compare): Fix
	transformation of a>=0 into (unsigned)a<0x80000000.

	* gcc.c-torture/execute/20030920-1.c: New test case.

From-SVN: r71618
This commit is contained in:
Roger Sayle 2003-09-21 02:22:45 +00:00 committed by Roger Sayle
parent 86b0a4f337
commit ccea753c05
4 changed files with 27 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2003-09-20 Roger Sayle <roger@eyesopen.com>
* config/i386/i386.c (ix86_expand_carry_flag_compare): Fix
transformation of a>=0 into (unsigned)a<0x80000000.
2003-09-20 Andrew Pinski <apinski@apple.com>
* config/darwin.c (machopic_select_rtx_section): Fix check for PIC code.

View file

@ -9469,19 +9469,19 @@ ix86_expand_carry_flag_compare (enum rtx_code code, rtx op0, rtx op1, rtx *pop)
}
break;
/* Convert a>0 into (unsigned)a<0x7fffffff. */
/* Convert a>=0 into (unsigned)a<0x80000000. */
case LT:
case GE:
if (mode == DImode || op1 != const0_rtx)
return false;
op1 = gen_int_mode (~(1 << (GET_MODE_BITSIZE (mode) - 1)), mode);
op1 = gen_int_mode (1 << (GET_MODE_BITSIZE (mode) - 1), mode);
code = (code == LT ? GEU : LTU);
break;
case LE:
case GT:
if (mode == DImode || op1 != constm1_rtx)
return false;
op1 = gen_int_mode (~(1 << (GET_MODE_BITSIZE (mode) - 1)), mode);
op1 = gen_int_mode (1 << (GET_MODE_BITSIZE (mode) - 1), mode);
code = (code == LE ? GEU : LTU);
break;

View file

@ -1,3 +1,7 @@
2003-09-20 Roger Sayle <roger@eyesopen.com>
* gcc.c-torture/execute/20030920-1.c: New test case.
2003-09-20 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
* g++.dg/rtti/typeid3.C: Correct expected error message.

View file

@ -0,0 +1,15 @@
extern void abort (void);
int main()
{
int hicount = 0;
unsigned char *c;
char *str = "\x7f\xff";
for (c = (unsigned char *)str; *c ; c++) {
if (!(((unsigned int)(*c)) < 0x80)) hicount++;
}
if (hicount != 1)
abort ();
return 0;
}