aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2011-04-14 17:10:24 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2011-04-14 10:10:24 -0700
commit6f19785029f4aa8cf9f78fbd9bd446ba990f4a78 (patch)
tree1bdafddaa9abbcb7ff7c12c2bc68d82a2bc5d73b /gcc/cfgexpand.c
parent545f261bef70b517ea65b5a827444c41b4bba4cd (diff)
downloadgcc-6f19785029f4aa8cf9f78fbd9bd446ba990f4a78.zip
gcc-6f19785029f4aa8cf9f78fbd9bd446ba990f4a78.tar.gz
gcc-6f19785029f4aa8cf9f78fbd9bd446ba990f4a78.tar.bz2
Update alignment on local variables.
2011-04-14 H.J. Lu <hongjiu.lu@intel.com> PR middle-end/48608 * cfgexpand.c (get_decl_align_unit): Renamed to ... (align_local_variable): This. Update DECL_ALIGN. (add_stack_var): Updated. (expand_one_stack_var): Likewise. From-SVN: r172438
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index cc1382f..d84c57e 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -205,13 +205,14 @@ static bool has_protected_decls;
smaller than our cutoff threshold. Used for -Wstack-protector. */
static bool has_short_buffer;
-/* Discover the byte alignment to use for DECL. Ignore alignment
+/* Compute the byte alignment to use for DECL. Ignore alignment
we can't do with expected alignment of the stack boundary. */
static unsigned int
-get_decl_align_unit (tree decl)
+align_local_variable (tree decl)
{
unsigned int align = LOCAL_DECL_ALIGNMENT (decl);
+ DECL_ALIGN (decl) = align;
return align / BITS_PER_UNIT;
}
@@ -273,7 +274,7 @@ add_stack_var (tree decl)
variables that are simultaneously live. */
if (v->size == 0)
v->size = 1;
- v->alignb = get_decl_align_unit (SSAVAR (decl));
+ v->alignb = align_local_variable (SSAVAR (decl));
/* All variables are initially in their own partition. */
v->representative = stack_vars_num;
@@ -905,7 +906,7 @@ expand_one_stack_var (tree var)
unsigned byte_align;
size = tree_low_cst (DECL_SIZE_UNIT (SSAVAR (var)), 1);
- byte_align = get_decl_align_unit (SSAVAR (var));
+ byte_align = align_local_variable (SSAVAR (var));
/* We handle highly aligned variables in expand_stack_vars. */
gcc_assert (byte_align * BITS_PER_UNIT <= MAX_SUPPORTED_STACK_ALIGNMENT);