This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problem with alias-safe code


On Sun, Jun 28, 1998 at 10:38:50AM -0700, Mark Mitchell wrote:
> Oh, dear.  I always get bogged down in these GCC extensions.  I'm sure
> there's a good reason for them, but in this case why not just write:
> 
>   double my_fabs (double x)
>   {
>     union u_t { double d; int i[2]; };
>     ((union u_t*) &x)->i[1] &=  0x7fffffff;
>     return x;
>   }

Oh.  Mostly cause we thought that the address-taking there would also
run afoul of the alias code, and that our only safe and standard option
was to copy the data into a union before manipulating it.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]