Floating Pt. Optimize on PA

Jeffrey A Law law@cygnus.com
Tue Dec 29 19:12:00 GMT 1998


  In message < 13959.64962.70266.111088@cetus.cygnus.com >you write:
  >  > Then what *is* the correct way to access the two words that comprise a
  >  > doubleword object?
  > 
  > memcpy it to an array of ints, and manipulate it, memcpy it back if
  > you want to change the double; use memmove instead if the array of
  > ints and the double could overlap.
Yup.  That is the most portable way.

You can play some games with unions using gcc, but it's unportable.

ie

union blah
{
  double d;
  int x[2];
};


GCC will keep reads/writes consistent in such unions, even though ANSI does
not mandate such consistency.

jeff



More information about the Gcc-bugs mailing list