[Top] [All Lists]

Re: gcc crash

To: Kjeld Borch Egevang <>
Subject: Re: gcc crash
From: Keith Owens <>
Date: Fri, 28 Sep 2001 22:37:52 +1000
Cc: linux-mips mailing list <>
In-reply-to: Your message of "Thu, 27 Sep 2001 16:59:47 +0200." <>
On Thu, 27 Sep 2001 16:59:47 +0200 (CEST), 
Kjeld Borch Egevang <> 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.

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