pro64-support
[Top] [All Lists]

Re: simple program crashes pro64

To: Steven Tjiang <tjiang@xxxxxxxxxxxxx>
Subject: Re: simple program crashes pro64
From: Chandrasekhar Murthy <murthy@xxxxxxx>
Date: Wed, 12 Jul 2000 23:30:41 -0700
Cc: Pro64 Support Mailing List <pro64-support@xxxxxxxxxxx>
References: <200007122255.PAA26426@gaea.engr.sgi.com> <050501bfec55$09dc96d0$750aa8c0@hq.tensilica.com> <396CFDC0.F406C3FA@sgi.com> <052b01bfec5b$c0decff0$750aa8c0@hq.tensilica.com>
Sender: owner-pro64-support@xxxxxxxxxxx
Steven Tjiang wrote:
> 
> Hi.
> 
> Thanks for your help.
> 
> Though the program now compiles, the assembler
> output appears incorrect.  The assembler code discards the
> return value of the call to d() and instead passes the value of
> an undefined symbol .preg_C8 to the printf.  It is interesting that
> .preg_C8 is the special symbol used for all pseudo registers of type
> C8.
> 
> On further examination of the trace file, a phase named
> "WN_lower: Pre-Opt" rewrites the operations on complex
> data types to operations on doubles (i.e. revealing the
> real and imaginary operations for the optimizer), but the
> phase fails to rewrite the parameters of the printf.  Therefore,
> the lowered code has no use and the optimizer subsequently removes
> the code.  This results in the hanging reference to a pseudo register
> of type C8, hence the reference to .preg_C8.
> 
> Is this diagnoses correct?  It seems like a proper fix would include
> modifying the lowering phase to rewrite actual parameters of complex types
> but I don't know enough about the compiler to see other repercussions
> of such a change.
> 
> ----- Original Message -----
> From: "Chandrasekhar Murthy" <murthy@xxxxxxx>
> To: "Steven Tjiang" <tjiang@xxxxxxxxxxxxx>
> Cc: "Pro64 Support Mailing List" <pro64-support@xxxxxxxxxxx>
> Sent: Wednesday, July 12, 2000 4:22 PM
> Subject: Re: simple program crashes pro64
> 
> > Steven Tjiang wrote:
> > >
> > > Adding then include allow compilation to finish.  Thanks.
> > > But should it have crashed in the first place?
> > >
> > > ----- Original Message -----
> > > From: "Chandrasekhar Murthy" <murthy@xxxxxxxxxxxxxxxxx>
> > > To: "Pro64 Support Mailing List" <pro64-support@xxxxxxxxxxx>; "Steven
> > > Tjiang" <tjiang@xxxxxxxxxxxxx>
> > > Sent: Wednesday, July 12, 2000 3:55 PM
> > > Subject: Re: simple program crashes pro64
> > >
> > > > Does it fail if you also add the following include
> > > >
> > > > #include <stdio.h>
> > > >
> > > > Murthy
> > > >
> >
> > No it should not have crashed at compile time.
> > However, you need the include in order to get
> > the right runt time behavior because of varargs.
> >
> > I will take a look at the compile time failure.
> >

It appears to be a lowering problem.

One workaround would be to rewrite the program as follows
#include <stdio.h>
typedef __complex__ double bigint;
bigint d()
{
  return 1;
}
main ()
{
  bigint e;
  e = d();
  printf("%llf", e);
}

The output is then the same with sgicc as with the
stock gcc compiler, but it is still does not
look correct.

<Prev in Thread] Current Thread [Next in Thread>