diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2015-10-09 12:18:40 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2015-10-09 12:18:40 +0000 |
commit | fc5851fe3df132cc4cccb21f8b1cd8fbb577b38c (patch) | |
tree | f59af59cf3156be5a68ea0c52a78899cd7a2102d | |
parent | f813d16ec532adc9760b0d6d4574b2028034b73a (diff) | |
download | gcc-fc5851fe3df132cc4cccb21f8b1cd8fbb577b38c.zip gcc-fc5851fe3df132cc4cccb21f8b1cd8fbb577b38c.tar.gz gcc-fc5851fe3df132cc4cccb21f8b1cd8fbb577b38c.tar.bz2 |
[PR67766] reorder handling of parallels, concats and promoted values in return
for gcc/ChangeLog
PR middle-end/67766
* function.c (expand_function_end): Move return value
promotion past the handling of PARALLELs and CONCATs.
From-SVN: r228651
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/function.c | 24 |
2 files changed, 16 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e31c180..cba70ef 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2015-10-09 Alexandre Oliva <aoliva@redhat.com> + PR middle-end/67766 + * function.c (expand_function_end): Move return value + promotion past the handling of PARALLELs and CONCATs. + PR rtl-optimization/67828 * tree-ssa-loop-unswitch.c: Include tree-ssa.h. (tree_may_unswitch_on): Don't unswitch on expressions diff --git a/gcc/function.c b/gcc/function.c index e76ba2b..d16d6d8 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -5446,18 +5446,6 @@ expand_function_end (void) decl_rtl); shift_return_value (GET_MODE (decl_rtl), true, real_decl_rtl); } - /* If a named return value dumped decl_return to memory, then - we may need to re-do the PROMOTE_MODE signed/unsigned - extension. */ - else if (GET_MODE (real_decl_rtl) != GET_MODE (decl_rtl)) - { - int unsignedp = TYPE_UNSIGNED (TREE_TYPE (decl_result)); - promote_function_mode (TREE_TYPE (decl_result), - GET_MODE (decl_rtl), &unsignedp, - TREE_TYPE (current_function_decl), 1); - - convert_move (real_decl_rtl, decl_rtl, unsignedp); - } else if (GET_CODE (real_decl_rtl) == PARALLEL) { /* If expand_function_start has created a PARALLEL for decl_rtl, @@ -5488,6 +5476,18 @@ expand_function_end (void) emit_move_insn (tmp, decl_rtl); emit_move_insn (real_decl_rtl, tmp); } + /* If a named return value dumped decl_return to memory, then + we may need to re-do the PROMOTE_MODE signed/unsigned + extension. */ + else if (GET_MODE (real_decl_rtl) != GET_MODE (decl_rtl)) + { + int unsignedp = TYPE_UNSIGNED (TREE_TYPE (decl_result)); + promote_function_mode (TREE_TYPE (decl_result), + GET_MODE (decl_rtl), &unsignedp, + TREE_TYPE (current_function_decl), 1); + + convert_move (real_decl_rtl, decl_rtl, unsignedp); + } else emit_move_insn (real_decl_rtl, decl_rtl); } |