diff options
author | sje <sje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-22 18:14:27 +0000 |
---|---|---|
committer | sje <sje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-22 18:14:27 +0000 |
commit | 595a5656a11c75c4cda95ad95ac71bd06cac3781 (patch) | |
tree | 4695229a652f71c1c01cd181febab6abd576b309 /gcc/stmt.c | |
parent | edb83fcb58edcfc7c5c4d83fa8054bac11ca8142 (diff) | |
download | gcc-595a5656a11c75c4cda95ad95ac71bd06cac3781.tar.gz |
2010-07-22 Steve Ellcey <sje@cup.hp.com>
PR middle-end/44878
* stmt.c (expand_value_return): Call promote_function_mode with
a for_return argument of 2 when returning by reference.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162423 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c index 8420aaa50da..0b9ce8184f6 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -1595,8 +1595,11 @@ expand_value_return (rtx val) tree type = TREE_TYPE (decl); int unsignedp = TYPE_UNSIGNED (type); enum machine_mode old_mode = DECL_MODE (decl); - enum machine_mode mode = promote_function_mode (type, old_mode, - &unsignedp, funtype, 1); + enum machine_mode mode; + if (DECL_BY_REFERENCE (decl)) + mode = promote_function_mode (type, old_mode, &unsignedp, funtype, 2); + else + mode = promote_function_mode (type, old_mode, &unsignedp, funtype, 1); if (mode != old_mode) val = convert_modes (mode, old_mode, val, unsignedp); |