Hello All:

Gatekeeper could you please review the fix for bug Id 732. The changes are made 
in wgen_expr.cxx
And wn_lower.cxx.

In wgen_expr.cxx the  copy the -1 preg to a temp area is not done when for 
GS_CALL_EXPR and the
Passed is GS_ADDR_EXPR with operand as  GS_VAR_DECL. The MTYPE_M is not 
supported on wn_lower.cxx
Added the changes for that.

Following files are modified.
Osprey/wgen/wgen_expr.cxx
Osprey/be/com/wn_lower.cxx

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

Thanks & Regards
Ajit

Attachment: 732.diff
Description: 732.diff

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to