Re: gcc crash

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

 



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.



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

  Powered by Linux