This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

Re: middle-end/9725: Invalid dependency determination


> 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 at ticam dot utexas dot edu
                              www: http://www.ticam.utexas.edu/~bangerth/



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