summaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2012-06-13 21:21:24 +0000
committerMark Kettenis <kettenis@gnu.org>2012-06-13 21:21:24 +0000
commit15b692d89066c419cc5d802344d6bb31a4307d50 (patch)
treee0562026660e2e7abe1f8ffd4704e7ff8c010904 /gdb/i386-tdep.c
parent8ff506ab4d82a2e2747e95a3cda750641eee99dc (diff)
downloadgdb-15b692d89066c419cc5d802344d6bb31a4307d50.tar.gz
PR tdep/14222
* i386-tdep.c (i386_push_dummy_call): Unconditionally align the stack on a 16-byte boundary.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 6333556c994..ce4c8a4cac2 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -2351,7 +2351,6 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
for (write_pass = 0; write_pass < 2; write_pass++)
{
int args_space_used = 0;
- int have_16_byte_aligned_arg = 0;
if (struct_return)
{
@@ -2389,19 +2388,20 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
else
{
if (i386_16_byte_align_p (value_enclosing_type (args[i])))
- {
- args_space = align_up (args_space, 16);
- have_16_byte_aligned_arg = 1;
- }
+ args_space = align_up (args_space, 16);
args_space += align_up (len, 4);
}
}
if (!write_pass)
{
- if (have_16_byte_aligned_arg)
- args_space = align_up (args_space, 16);
sp -= args_space;
+
+ /* The original System V ABI only requires word alignment,
+ but modern incarnations need 16-byte alignment in order
+ to support SSE. Since wasting a few bytes here isn't
+ harmful we unconditionally enforce 16-byte alignment. */
+ sp &= ~0xf;
}
}