This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ipa/69990] [5/6 Regression] decl alignment not respected
- From: "amodra at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 29 Feb 2016 14:04:23 +0000
- Subject: [Bug ipa/69990] [5/6 Regression] decl alignment not respected
- Auto-submitted: auto-generated
- References: <bug-69990-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69990
--- Comment #5 from Alan Modra <amodra at gmail dot com> ---
I don't think we can make the decl with the larger alignment prevail. Aren't
we stuck with "c" due to it being referenced by the constructor?
It goes like:
1) "c" is referenced in a constructor, thus make_decl_rtl for "c"
2) make_decl_rtl puts "c" in an anchor block,
3) anchor block contents can't move, so "c" alignment can't change,
4) "a" can be changed by ipa_increase_alignment, and the alias info isn't yet
available so there's no way to stop that happening,
5) "a" therefore must be prevented from aliasing "c".
I guess testing for exact equality of alignment is too strict, and I should
also allow an alias from smaller to larger alignment if the larger alignment is
a multiple of the smaller.