diff options
author | Steve Ellcey <sellcey@imgtec.com> | 2015-03-05 16:34:03 +0000 |
---|---|---|
committer | Steve Ellcey <sje@gcc.gnu.org> | 2015-03-05 16:34:03 +0000 |
commit | a8eeec27a94869785782a2d98969b437c4c5d62e (patch) | |
tree | 1793aeb9ad14055ff15e45441897b03c0f588054 /gcc/cfgexpand.c | |
parent | 7ef9618369ffd71826f093077eaae3f35c15755b (diff) | |
download | gcc-a8eeec27a94869785782a2d98969b437c4c5d62e.zip gcc-a8eeec27a94869785782a2d98969b437c4c5d62e.tar.gz gcc-a8eeec27a94869785782a2d98969b437c4c5d62e.tar.bz2 |
re PR middle-end/65315 (incorrect alignment of local variable with aligned attribute)
2015-03-05 Steve Ellcey <sellcey@imgtec.com>
PR middle-end/65315
* cfgexpand.c (expand_stack_vars): Update large_align to maximum
needed alignment.
From-SVN: r221219
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 7dfe1f6..569cd0d 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -973,6 +973,13 @@ expand_stack_vars (bool (*pred) (size_t), struct stack_vars_data *data) i = stack_vars_sorted[si]; alignb = stack_vars[i].alignb; + /* All "large" alignment decls come before all "small" alignment + decls, but "large" alignment decls are not sorted based on + their alignment. Increase large_align to track the largest + required alignment. */ + if ((alignb * BITS_PER_UNIT) > large_align) + large_align = alignb * BITS_PER_UNIT; + /* Stop when we get to the first decl with "small" alignment. */ if (alignb * BITS_PER_UNIT <= MAX_SUPPORTED_STACK_ALIGNMENT) break; |