From: Steve Ellcey Date: Thu, 22 Jul 2010 18:14:27 +0000 (+0000) Subject: re PR middle-end/44878 (Build fails when compiling libstdc++) X-Git-Tag: releases/gcc-4.6.0~5503 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=426d63337543926a4b9343919c2ceb191d018433;p=thirdparty%2Fgcc.git re PR middle-end/44878 (Build fails when compiling libstdc++) 2010-07-22 Steve Ellcey PR middle-end/44878 * stmt.c (expand_value_return): Call promote_function_mode with a for_return argument of 2 when returning by reference. From-SVN: r162423 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1d52a085af8d..84ac1b41bde3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-07-22 Steve Ellcey + + PR middle-end/44878 + * stmt.c (expand_value_return): Call promote_function_mode with + a for_return argument of 2 when returning by reference. + 2010-07-22 Dodji Seketeli PR debug/45024 diff --git a/gcc/stmt.c b/gcc/stmt.c index 8420aaa50dad..0b9ce8184f67 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);