This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/44542] expand_one_stack_var_at may set DECL_ALIGN to a too high value
- From: "hjl dot tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jun 2010 14:36:30 -0000
- Subject: [Bug target/44542] expand_one_stack_var_at may set DECL_ALIGN to a too high value
- References: <bug-44542-87@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #14 from hjl dot tools at gmail dot com 2010-06-16 14:36 -------
The code in question is
offset -= frame_phase;
align = offset & -offset;
align *= BITS_PER_UNIT;
if (align == 0)
align = STACK_BOUNDARY;
else if (align > MAX_SUPPORTED_STACK_ALIGNMENT)
align = MAX_SUPPORTED_STACK_ALIGNMENT;
offset is computed from
align = get_decl_align_unit (SSAVAR (var));
offset = alloc_stack_frame_space (size, align);
If you compute alignment from offset again, you
will get a number >= requested alignment. That is
when we allocate 8byte aligned at 8byte from stack,
we may get offset 8, 16, 24, 32, 40, 48, 56, 64,
... depending on how much we have allocated on stack.
As for MAX_SUPPORTED_STACK_ALIGNMENT, I doubt we
will hit it since it is a huge number.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44542