public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* patch that caused regression PR c/7949
@ 2003-01-06 22:54 Janis Johnson
  0 siblings, 0 replies; only message in thread
From: Janis Johnson @ 2003-01-06 22:54 UTC (permalink / raw)
  To: gcc, jh

The regression reported in PR c/7949 showed up starting
with this patch:

Tue Feb 19 12:37:23 CET 2002  Jan Hubicka  <jh@suse.cz>

	* regmove.c (regmove_optimize): Avoid increasing of register pressure.

Here's the test case from the PR that I used on i686-linux:

-------------------
/* Incorrect results when compiled with -O2 with 3.1 or later */

double rvals(int v)
{
  union a {
    double d;
    unsigned int i[2];
  } aa;

  if (v == 0) {
    /* Return maximum double */
    /* For bigendian machines swap i[0] and i[1] */
    aa.i[0] = 0xffffffff;
    aa.i[1] = 0x7fefffff;
  } else {
    /* Return minimum double */
    /* For bigendian machines swap i[0] and i[1] */
    aa.i[0] = 0;
    aa.i[1] = 0x100000;
  }

  return aa.d;
}
main()
{
  double rmax, rmin, inf, zero;
  union a {
    double d;
    unsigned int i[2];
  } aa;

  rmax = rvals(0);
  rmin = rvals(1);

  inf = rmax / rmin;
  zero = 1.0 / inf;

  if (zero != 0.0) {
    printf("ERROR\n");
    aa.d = rmax;
    printf("rmax: i[0] = %x, i[1] = %x\n", aa.i[0], aa.i[1]);
    aa.d = rmin;
    printf("rmin: i[0] = %x, i[1] = %x\n", aa.i[0], aa.i[1]);
    aa.d = inf;
    printf("inf: i[0] = %x, i[1] = %x\n", aa.i[0], aa.i[1]);
    aa.d = zero;
    printf("zero: i[0] = %x, i[1] = %x\n", aa.i[0], aa.i[1]);
  } else {
    printf("This works.\n");
  }
}
-------------------

I've added this information to the PR.

Is the test case valid?

Janis

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-01-06 22:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-06 22:54 patch that caused regression PR c/7949 Janis Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).