Commit b8460b29 by Zack Weinberg

re PR rtl-optimization/10024 ([HP-PA] inline optimization ICE)

	PR optimization/10024
	* gcc.c-torture/compile/20030405-1.c: New test.

From-SVN: r65280
parent 8e33fb63
2003-04-05 Zack Weinberg <zack@codesourcery.com>
PR optimization/10024
* gcc.c-torture/compile/20030405-1.c: New test.
2003-04-04 Geoffrey Keating <geoffk@apple.com>
* gcc.dg/pch/static-3.c: New.
......
/* PR optimization/10024 */
extern int *allegro_errno;
typedef long fixed;
extern inline int
fixfloor (fixed x)
{
if (x >= 0)
return (x >> 16);
else
return ~((~x) >> 16);
}
extern inline int
fixtoi (fixed x)
{
return fixfloor (x) + ((x & 0x8000) >> 15);
}
extern inline fixed
ftofix (double x)
{
if (x > 32767.0)
{
*allegro_errno = 34;
return 0x7FFFFFFF;
}
if (x < -32767.0)
{
*allegro_errno = 34;
return -0x7FFFFFFF;
}
return (long) (x * 65536.0 + (x < 0 ? -0.5 : 0.5));
}
extern inline double
fixtof (fixed x)
{
return (double) x / 65536.0;
}
extern inline fixed
fixdiv (fixed x, fixed y)
{
if (y == 0)
{
*allegro_errno = 34;
return (x < 0) ? -0x7FFFFFFF : 0x7FFFFFFF;
}
else
return ftofix (fixtof (x) / fixtof (y));
}
extern inline fixed
itofix (int x)
{
return x << 16;
}
int
foo (int n)
{
return fixtoi (fixdiv (itofix (512), itofix (n)));
}
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