diff options
Diffstat (limited to 'gcc/explow.c')
-rw-r--r-- | gcc/explow.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index 6941f4e..d104a79 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -830,8 +830,10 @@ promote_decl_mode (const_tree decl, int *punsignedp) machine_mode mode = DECL_MODE (decl); machine_mode pmode; - if (TREE_CODE (decl) == RESULT_DECL - || TREE_CODE (decl) == PARM_DECL) + if (TREE_CODE (decl) == RESULT_DECL && !DECL_BY_REFERENCE (decl)) + pmode = promote_function_mode (type, mode, &unsignedp, + TREE_TYPE (current_function_decl), 1); + else if (TREE_CODE (decl) == RESULT_DECL || TREE_CODE (decl) == PARM_DECL) pmode = promote_function_mode (type, mode, &unsignedp, TREE_TYPE (current_function_decl), 2); else @@ -857,12 +859,23 @@ promote_ssa_mode (const_tree name, int *punsignedp) if (SSA_NAME_VAR (name) && (TREE_CODE (SSA_NAME_VAR (name)) == PARM_DECL || TREE_CODE (SSA_NAME_VAR (name)) == RESULT_DECL)) - return promote_decl_mode (SSA_NAME_VAR (name), punsignedp); + { + machine_mode mode = promote_decl_mode (SSA_NAME_VAR (name), punsignedp); + if (mode != BLKmode) + return mode; + } tree type = TREE_TYPE (name); int unsignedp = TYPE_UNSIGNED (type); machine_mode mode = TYPE_MODE (type); + /* Bypass TYPE_MODE when it maps vector modes to BLKmode. */ + if (mode == BLKmode) + { + gcc_assert (VECTOR_TYPE_P (type)); + mode = type->type_common.mode; + } + machine_mode pmode = promote_mode (type, mode, &unsignedp); if (punsignedp) *punsignedp = unsignedp; |