This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

egcs-19990112 sparcv9 FP bug


Dear Friends,

There's a problem moving the result of fdtox to an integer register.
The second time that's done in the appended program, the wrong half of
the FP reg is stored.  Strangely, the first time it works.  We get:

	fdtox	%f4, %f2
	st	%f3, [%fp+2027]
	ld	[%fp+2027], %o1

But the second time, we get:

	fdtox	%f4, %f2
	st	%f2, [%fp+2031]
	ld	[%fp+2031], %o1


This is in snapshot 19990112 configured with
--target=sparcv9-sun-solaris2.

For what it's worth, this was exposed by the "assign" test of the
exprtest section of an old copy of Plum Hall.

If I can add anything useful, please let me know.  Thank you for your
help.

Jerry


Test program:

double D;

static double *
pD (void)
{
  return &D;
}

int
eqtest (int op1,
	int op2)
{
  return op1 == op2;
}

main (void)
{
  unsigned int ui;
  int result;

  *pD() = 16;
  ui = *pD();
  result = eqtest (ui, (unsigned int) 16);
  result += eqtest (ui = *pD(), (unsigned int) 16);
  return result;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]