This is the mail archive of the gcc-patches@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]

Re: always use pseudo return regs


The 23May patch
(http://gcc.gnu.org/ml/gcc-patches/2001-05/msg01629.html) to
gcc/function.c causes gcc 3.1 for mips-sgi-irix6.5 to crash on test
cases gcc.c-torture/compile/981007-1.c and
gcc.c-torture/execute/complex-3.c.

Reversing the patch permits successful compilation for both (attached)
preprocessed sources using a Linux->Irix cross compiler.

Would you please modify the patch so these test cases compile
correctly?

Thanks,
Jeffrey D. Oldham
oldham@codesourcery.com
# 1 "/users/joldham/pooma/dev4/gcc/gcc/testsuite/gcc.c-torture/execute/complex-3.c"
struct complex
{
  float r;
  float i;
};

struct complex cmplx (float, float);

struct complex
f (float a, float b)
{
  struct complex c;
  c.r = a;
  c.i = b;
  return c;
}

main ()
{
  struct complex z = f (1.0, 0.0);

  if (z.r != 1.0 || z.i != 0.0)
    abort ();
  exit (0);
}
# 1 "/users/joldham/pooma/dev4/gcc/gcc/testsuite/gcc.c-torture/compile/981007-1.c"
extern double fabs (double);
extern double sqrt (double);

typedef struct complexm {
  double re,im;
} complex;

static complex
setCom (double r, double i)
{
  complex ct;
  ct.re=fabs(r)<1E-300?0.0:r;
  ct.im=fabs(i)<1E-300?0.0:i;
  return ct;
}

static complex
csqrt_crash (double x)
{
  return (x>=0) ? setCom(sqrt(x),0) : setCom(0,sqrt(-x));
}

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