Re: Fields, unions, and code quality

2006-06-20 Thread Andrew Haley
Andrew Pinski writes: > > On Jun 20, 2006, at 7:20 AM, Andrew Haley wrote: > > > Does using fields of auto variables of union type generate code that > > is less efficient than it would be using scalars? > > If it is only one used field at a time (and the address is not taken), > then FR

Re: Fields, unions, and code quality

2006-06-20 Thread Daniel Berlin
Andrew Haley wrote: > Does using fields of auto variables of union type generate code that > is less efficient than it would be using scalars? > > That is, if in C++ I declare my variables as > > foo() > { > union > { > int n; > }; > > ... > } > > as opposed to simply > > foo() > {

Re: Fields, unions, and code quality

2006-06-20 Thread Andrew Pinski
On Jun 20, 2006, at 7:20 AM, Andrew Haley wrote: Does using fields of auto variables of union type generate code that is less efficient than it would be using scalars? If it is only one used field at a time (and the address is not taken), then FRE will resolve them. Take: int f(int t, int t1