This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] i386: Do not align small stack slots to 16 bytes
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: ubizjak at gmail dot com, Segher Boessenkool <segher at kernel dot crashing dot org>, Shmuel Hanoch <shmuel at infinitylabs dot co dot il>
- Date: Mon, 6 Mar 2017 17:51:15 +0000
- Subject: [PATCH] i386: Do not align small stack slots to 16 bytes
- Authentication-results: sourceware.org; auth=none
As Shmuel reported in <https://gcc.gnu.org/ml/gcc-help/2017-03/msg00009.html>,
on x86-64 small structures in automatic storage are aligned to 16 bytes.
This seems to be because of a mix-up between bits and bytes in the i386
target code.
Is this okay for trunk?
Segher
2017-03-06 Segher Boessenkool <segher@kernel.crashing.org>
* gcc/config/i386/i386.c (ix86_local_alignment): Align most aggregates
of 16 bytes and more to 16 bytes, not those of 16 bits and more.
---
gcc/config/i386/i386.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 754c016..f03e71a 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -30467,7 +30467,7 @@ ix86_local_alignment (tree exp, machine_mode mode,
!= TYPE_MAIN_VARIANT (va_list_type_node)))
&& TYPE_SIZE (type)
&& TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
- && wi::geu_p (TYPE_SIZE (type), 16)
+ && wi::geu_p (TYPE_SIZE (type), 128)
&& align < 128)
return 128;
}
--
1.9.3