This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Don't override user alignment with the same value
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 19 Aug 2017 13:18:22 -0700
- Subject: [PATCH] Don't override user alignment with the same value
- Authentication-results: sourceware.org; auth=none
Don't override alignment specified by user with the same value to
preserve TYPE_USER_ALIGN. This fixes PR 53037 tests on Sparc.
Does it look right?
H.J.
--
* stor-layout.c (finalize_type_size): Don't override alignment
specified by user with the same value.
---
gcc/stor-layout.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 3028d55773a..6dd605810ac 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -1784,7 +1784,7 @@ finalize_type_size (tree type)
/* Don't override a larger alignment requirement coming from a user
alignment of one of the fields. */
- if (mode_align >= TYPE_ALIGN (type))
+ if (mode_align > TYPE_ALIGN (type))
{
SET_TYPE_ALIGN (type, mode_align);
TYPE_USER_ALIGN (type) = 0;
--
2.13.5