summaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-27 11:57:01 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-27 11:57:01 +0000
commit8560c588b8e703a936e09b8b1c5381289b6fe2a8 (patch)
tree6551aaedcd3c7893355d5933f81fbb2dce9863de /gcc/cfgexpand.c
parentc3986c7ab5d242067928f202cc5f7c661242ce2a (diff)
downloadgcc-8560c588b8e703a936e09b8b1c5381289b6fe2a8.tar.gz
2010-09-27 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 164647 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@164648 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 42372769049..f9d3fa6087e 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -205,19 +205,11 @@ 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
- we can't do with expected alignment of the stack boundary. */
+/* Update stack alignment requirement. */
-static unsigned int
-get_decl_align_unit (tree decl)
+static void
+update_stack_alignment (unsigned int align)
{
- unsigned int align;
-
- align = LOCAL_DECL_ALIGNMENT (decl);
-
- if (align > MAX_SUPPORTED_STACK_ALIGNMENT)
- align = MAX_SUPPORTED_STACK_ALIGNMENT;
-
if (SUPPORTS_STACK_ALIGNMENT)
{
if (crtl->stack_alignment_estimated < align)
@@ -233,6 +225,22 @@ get_decl_align_unit (tree decl)
crtl->stack_alignment_needed = align;
if (crtl->max_used_stack_slot_alignment < align)
crtl->max_used_stack_slot_alignment = align;
+}
+
+/* Discover 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)
+{
+ unsigned int align;
+
+ align = LOCAL_DECL_ALIGNMENT (decl);
+
+ if (align > MAX_SUPPORTED_STACK_ALIGNMENT)
+ align = MAX_SUPPORTED_STACK_ALIGNMENT;
+
+ update_stack_alignment (align);
return align / BITS_PER_UNIT;
}
@@ -730,8 +738,7 @@ expand_one_stack_var_at (tree decl, HOST_WIDE_INT offset)
offset -= frame_phase;
align = offset & -offset;
align *= BITS_PER_UNIT;
- max_align = MAX (crtl->max_used_stack_slot_alignment,
- PREFERRED_STACK_BOUNDARY);
+ max_align = crtl->max_used_stack_slot_alignment;
if (align == 0 || align > max_align)
align = max_align;