This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Fields, unions, and code quality
- From: Andrew Haley <aph at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 20 Jun 2006 15:20:26 +0100
- Subject: Fields, unions, and code quality
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()
{
int n;
...
}
would gcc generate inferior code? Or, are the tree-SSA optimizers so
powerful that it wouldn't make any difference?
[I'm looking at this to determine the best way to represent the trees
produced by the gcj front-end.]
Thanks,
Andrew.