diff options
author | Joern Rennecke <amylaar@gcc.gnu.org> | 2005-08-17 20:44:24 +0100 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2005-08-17 20:44:24 +0100 |
commit | c26104e4948427b5b95b7f3b8b1ed47c7e6e5850 (patch) | |
tree | f97337e92acb3af9df7008fe90433c142f97e6a1 /gcc | |
parent | dd0ae678ee0607a9d7bd758785bcecd654471dfa (diff) | |
download | gcc-c26104e4948427b5b95b7f3b8b1ed47c7e6e5850.zip gcc-c26104e4948427b5b95b7f3b8b1ed47c7e6e5850.tar.gz gcc-c26104e4948427b5b95b7f3b8b1ed47c7e6e5850.tar.bz2 |
sh.c (sh_gimplify_va_arg_expr): Don't substitute a RECORD_TYPE record with the type of its only member if...
* 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.
From-SVN: r103223
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/sh/sh.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index c9cd3c8..1205540 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) { |