Author: minz
Date: 2010-09-09 13:04:13 -0400 (Thu, 09 Sep 2010)
New Revision: 3337

Modified:
   trunk/osprey/wgen/wgen_expr.cxx
Log:
Fix for bug 593:

The IR generated for __builtin_va_arg (ap, _Complex long double) is as:
     U8LDA 0 <2,2,ap> T<69,anon_ptr.,8>
    U8U8ILOAD 8 T<9,.predef_U8,8> T<67,anon_ptr.,8>
   MMILOAD -32 T<23,.predef_C10,16> T<98,anon_ptr.,8>
This is not appropriate. We should generate C10C10ILOAD instead.

The problem is that the GS_VA_ARG_EXPR handling only considers MTYPE_C4, 
not other complex types (e.g., MTYPE_C8 or MTYPE_C10). 
The fix is to include them.

Code Review: Sun Chan



Modified: trunk/osprey/wgen/wgen_expr.cxx
===================================================================
--- trunk/osprey/wgen/wgen_expr.cxx     2010-09-08 02:24:23 UTC (rev 3336)
+++ trunk/osprey/wgen/wgen_expr.cxx     2010-09-09 17:04:13 UTC (rev 3337)
@@ -9901,9 +9901,12 @@
            wn = WN_CreateIload(OPR_ILOAD, Widen_Mtype (mtype), mtype, 0,
                                ty_idx, Make_Pointer_Type(ty_idx), wn);
          }
-         else if (mtype == MTYPE_C4) {
+         else if (MTYPE_is_complex(mtype)) {
+        Is_True((mtype == MTYPE_C4 || mtype == MTYPE_C8 || mtype == MTYPE_C10 
||
+            mtype == MTYPE_C16 || mtype == MTYPE_CQ),
+            ("WGEN_Expand_Expr: unexpected complex type"));
            wn = WGEN_x8664_va_arg(ap_wn, MTYPE_float(mtype), ty_idx, FALSE);
-           wn = WN_CreateIload(OPR_ILOAD, MTYPE_C4, MTYPE_C4, 0, ty_idx,
+           wn = WN_CreateIload(OPR_ILOAD, mtype, mtype, 0, ty_idx,
                                Make_Pointer_Type(ty_idx), wn);
          }
          else {


------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to