middle-end/9725: Invalid dependency determination

Jan Beulich JBeulich@novell.com
Wed Feb 19 17:09:00 GMT 2003


But why is the structure incompatible?

"... an aggregate or union type that includes one of the aforementioned
types among its
members (including, recursively, a member of a subaggregate or
contained union), ..."

The structure does include two fields of type 'unsigned' (the fact that
they are bit fields doesn't alter their type as I view it). And, as
already asked, when the second store is deemed non-conflicting, then why
isn't the first store, too? And, with respect to the other mail - short
of not using this logic - how do I access sub-fields of a built-in type
(while the code I have to fix for others to overcome the optimizer
problem uses ints, I'm really more interested in accessing sub-fields of
floating point types (other than through memcpy-ing the float into and
afterwards out of a structure)?

Thanks, Jan

>>> Wolfgang Bangerth <bangerth@ticam.utexas.edu> 19.02.03 17:59:46
>>>

> struct s {
> 	unsigned f1:16;
> 	unsigned f2:16;
> };
> 
> void test(unsigned *pf, unsigned x, unsigned y) {
> 	unsigned f;
> 
> 	((struct s*)&f)->f1 = x;
> 	((struct s*)&f)->f2 = y;
> 	*pf = f;
> }

You still try to access the bits of the unsigned int variable f through

the bits of the incompatible structure s. Short answer: don't do that.

W.

-------------------------------------------------------------------------
Wolfgang Bangerth             email:           
bangerth@ticam.utexas.edu 
                              www:
http://www.ticam.utexas.edu/~bangerth/ 




More information about the Gcc-bugs mailing list