This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/14319] incorrect optimization of union of structs with common initial sequences
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Feb 2004 19:24:12 -0000
- Subject: [Bug c/14319] incorrect optimization of union of structs with common initial sequences
- References: <20040227052920.14319.jsturm@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-02-27 19:24 -------
Leaving aside questions of what the standard actually (is supposed to) mean:
if the aliasing rules are changed as you propose, then
- adding a union somewhere to a code will change the code generated for
the function in your example, even if this union is not actually used
anywhere
- this takes away quite a number of opportunities for optimization, since
it is certainly not uncommon for code to use small structures that have,
say, an integer or pointer as first argument (think iterators and
accessors).
In my eyes, both are not exactly positive consequences. But that's a personal
opinion, not a language lawyer's statement.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14319