Re: gcc crash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 28, 2001 at 10:37:52PM +1000, Keith Owens wrote:

> On Thu, 27 Sep 2001 16:59:47 +0200 (CEST), 
> Kjeld Borch Egevang <kjelde@mips.com> wrote:
> >When I compile the following function with "gcc -O2" the compiler crashes.
> >static float sp_f2l(float x)
> >{
> >    long l, *xl;
> >    float y;
> >
> >    xl = (void *)&y;
> >    l = x;
> >    *xl = l;
> >    return y;
> >}
> 
> You are breaking the C rules for data accesses.  Compile with
> -fno-strict-aliasing if you want to break the rules.  Or, and this is
> much better, use a union of long and float to "convert" one
> representation to another.

Yes said the compiler is crashing so that's definately a gcc bug.  Aside
of course of the code itself being buggy also.

  Ralf


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux