This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Need someone to look at a regression
- To: richard dot earnshaw at arm dot com
- Subject: Re: Need someone to look at a regression
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Tue, 18 Aug 1998 18:02:03 +0100 (BST)
- Cc: jason at cygnus dot com, egcs at cygnus dot com, rearnsha at sun52 dot arm dot com
> It's a pity that the code below doesn't work.
>
> typedef struct
> {
> unsigned x, y;
> } foo __attribute__((mode (DF)));
>
> foo bar()
> {
> foo x;
> x.x = 0;
> x.y = 0;
> return x;
> }
>
> test.c: In function `bar':
> test.c:9: request for member `x' in something not a structure or union
> test.c:10: request for member `y' in something not a structure or union
>
> This would be an extremely useful way of breaking down a floating point
> number into its component bit-fields, without having to mess around with a
> union. It would certainly solve a problem I have at the moment,
> especially if the struct were passed to and from calls in the same way as
> a DFmode type.
You can use the 'transparent union' attribute for that. The floating
point member of the union has to be the first one.