This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/65315] incorrect alignment of local variable with aligned attribute
- From: "sje at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 04 Mar 2015 18:58:53 +0000
- Subject: [Bug middle-end/65315] incorrect alignment of local variable with aligned attribute
- Auto-submitted: auto-generated
- References: <bug-65315-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65315
--- Comment #1 from Steve Ellcey <sje at gcc dot gnu.org> ---
It might be easier to see this bug if you apply this patch:
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 7dfe1f6..7beb00e 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -973,6 +973,8 @@ expand_stack_vars (bool (*pred) (size_t), struct sta
ck_vars_data *data)
i = stack_vars_sorted[si];
alignb = stack_vars[i].alignb;
+ gcc_assert (alignb*BITS_PER_UNIT <= large_align);
+
/* Stop when we get to the first decl with "small" alignment. */
if (alignb * BITS_PER_UNIT <= MAX_SUPPORTED_STACK_ALIGNMENT)
break;
This way you get an ICE instead of just incorrectly aligned vectors.