URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* Copyright (C) 2002 Free Software Foundation.
|
/* Copyright (C) 2002 Free Software Foundation.
|
|
|
Ensure that the composite comparison optimization doesn't misfire
|
Ensure that the composite comparison optimization doesn't misfire
|
and attempt to combine a signed comparison with an unsigned one.
|
and attempt to combine a signed comparison with an unsigned one.
|
|
|
Written by Roger Sayle, 3rd June 2002. */
|
Written by Roger Sayle, 3rd June 2002. */
|
|
|
extern void abort (void);
|
extern void abort (void);
|
|
|
int
|
int
|
foo (int x, int y)
|
foo (int x, int y)
|
{
|
{
|
/* If miscompiled the following may become "x == y". */
|
/* If miscompiled the following may become "x == y". */
|
return (x<=y) && ((unsigned int)x >= (unsigned int)y);
|
return (x<=y) && ((unsigned int)x >= (unsigned int)y);
|
}
|
}
|
|
|
int
|
int
|
main ()
|
main ()
|
{
|
{
|
if (! foo (-1,0))
|
if (! foo (-1,0))
|
abort ();
|
abort ();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.