From ba59da21cb608695e32a7fc463f0fee4d982daa8 Mon Sep 17 00:00:00 2001 From: amylaar Date: Wed, 17 Aug 2005 19:44:24 +0000 Subject: [PATCH] * sh.c (sh_gimplify_va_arg_expr): Don't substitute a RECORD_TYPE record with the type of its only member if the modes don't match. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103223 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/sh/sh.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index c9cd3c83d45..12055408dd2 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -6684,7 +6684,15 @@ sh_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, && (TREE_CODE (TREE_TYPE (TYPE_FIELDS (type))) == REAL_TYPE || TREE_CODE (TREE_TYPE (TYPE_FIELDS (type))) == COMPLEX_TYPE) && TREE_CHAIN (TYPE_FIELDS (type)) == NULL_TREE) - type = TREE_TYPE (TYPE_FIELDS (type)); + { + tree field_type = TREE_TYPE (TYPE_FIELDS (type)); + + if (TYPE_MODE (type) == TYPE_MODE (field_type)) + type = field_type; + else + gcc_assert (TYPE_ALIGN (type) + < GET_MODE_ALIGNMENT (TYPE_MODE (field_type))); + } if (TARGET_SH4) { -- 2.11.4.GIT