Index: osprey/wgen/wgen_expr.cxx
===================================================================
--- osprey/wgen/wgen_expr.cxx	(revision 3495)
+++ osprey/wgen/wgen_expr.cxx	(working copy)
@@ -7899,6 +7899,7 @@
     case GS_AGGR_INIT_EXPR:
     case GS_CALL_EXPR:
       {
+        BOOL is_gs_addr_arg = FALSE;
 	gs_t arglist = gs_tree_operand (exp, 1);
         TYPE_ID ret_mtype;
         WN *call_wn;
@@ -9840,11 +9841,24 @@
 	      TY_mtype(TY_pointed(ty_idx)) == MTYPE_V) /* pointer to void */
 	    ty_idx = nop_ty_idx;
 #endif
+          if((ret_mtype == MTYPE_M) && (Is_Target_64bit()))
+          {
+            for (list = gs_tree_operand (exp, 1); list;
+                 list = gs_tree_chain (list)) {
+              if(gs_tree_code(gs_tree_value (list)) == GS_ADDR_EXPR)
+              {
+                if (gs_tree_code(
+                    gs_tree_operand(gs_tree_value (list),0)) == GS_VAR_DECL )
+                  is_gs_addr_arg = TRUE;
+              }
+           }
+         }
 	  wn1 = WN_Ldid (ret_mtype, -1, Return_Val_Preg, ty_idx);
 
-	  if (ret_mtype == MTYPE_M) { // copy the -1 preg to a temp area
+	  if (ret_mtype == MTYPE_M && (!is_gs_addr_arg)) { // copy the -1 preg to a temp area
 
 	    TY_IDX ret_ty_idx = ty_idx;
+            is_gs_addr_arg = FALSE;
 #ifndef KEY
 // bug 3735: the compiler cannot arbitrarily change the alignment of
 // individual structures
Index: osprey/be/com/wn_lower.cxx
===================================================================
--- osprey/be/com/wn_lower.cxx	(revision 3495)
+++ osprey/be/com/wn_lower.cxx	(working copy)
@@ -4855,6 +4855,13 @@
 #endif // TARG_X8664 || VECTOR_MTYPES
 
     case MTYPE_M:
+#if defined(TARG_X8664)
+      WN_st_idx(tree) = ST_st_idx(MTYPE_To_PREG(MTYPE_U8));
+      WN_load_offset(tree) = First_Int_Preg_Return_Offset;
+      WN_set_rtype(tree, MTYPE_U8);
+      WN_set_desc(tree, MTYPE_U8);
+      return tree;
+#endif
       Fail_FmtAssertion ("MLDID of Return_Val_Preg not allowed in middle"
 			 " of expression");
       /*NOTREACHED*/
@@ -11391,7 +11398,7 @@
                                                          : parm;
 
     ploc = Get_Output_Parameter_Location(TY_Of_Parameter(parm));
-    if (MTYPE_is_m(parmType))
+    if (MTYPE_is_m(parmType)&&(WN_operator(actual) != OPR_LDID))
     {
      /*
       * structure parameter
