------- Comment #10 from hjl at lucon dot org  2007-05-12 19:03 -------
Gcc 4.3 gives the same output for

float convert1( unsigned in )
{
        float f;
        __builtin_memcpy( &f, &in, sizeof( in ) );
        return f;
}

float convert2( unsigned in )
{
  union
    {
      float f;
      unsigned i;
    } x;
  x.i = in;
  return x.f;
}

while gcc 3.4 can optimize the first one. At least, gcc 4.3 is consistent.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30961

Reply via email to