Author: rramanar
Date: 2011-10-18 01:40:35 -0400 (Tue, 18 Oct 2011)
New Revision: 3767

Modified:
   trunk/osprey/be/com/wn_mp.cxx
   trunk/osprey/be/lno/minvariant.cxx
Log:
Fix for bug 815
https://bugs.open64.net/show_bug.cgi?id=815

code reviewed by Sun Chan
 
Tested the open64 regression suite with no new failures
I have tested with the h264 program as filed in the bug
report -- base/peak with ref data and other SPECCPU2006 (no new failures
with -O3 and -apo).
 
The problem here is specific to MP regions that contain somewhat
advanced reductions. 
 
The code that causes the assert is SYMBOL(WN_array_base(WN_kid0(wn)) in
"osprey/be/lno/minvariant.cxx". Here a symbol is requested but the
WN_opcode does not have the sym PROPERTY. The WN_opcode of array base is
actually an ADD. Similar issue is in line 4418 in
"osprey/be/com/wn_mp.cxx" when this reduction is localized. Here WN_st
is accessed on the address computing ADD node. The computed NULL value
causes a SEGV downstream in the call chain. To cause this error apply
the patch only to "osprey/be/lno/minvariant.cxx". My fix is to ignore
the reductions which do not have the sym property in the MP region. 
 
Here is the dump of reduction tree that causes the issues:
 
   U8U8LDID 0 <1,51,stats> T<57,anon_ptr.,8>
   U4INTCONST 400 (0x190)
  U8ADD
  U4INTCONST 10 (0xa)
   I4I4LDID 0 <2,8,_temp__ubtmp0> T<4,.predef_I4,4>
  U8I4CVT
 U8ARRAY 1 4
XPRAGMA 1 52 <null-st> # REDUCTION {line: 1/25}



Modified: trunk/osprey/be/com/wn_mp.cxx
===================================================================
--- trunk/osprey/be/com/wn_mp.cxx       2011-10-18 02:23:36 UTC (rev 3766)
+++ trunk/osprey/be/com/wn_mp.cxx       2011-10-18 05:40:35 UTC (rev 3767)
@@ -12332,12 +12332,18 @@
              if (Identical_Pragmas(cur_node, wn))
                break;
            if (wn == NULL) {
-             WN_next(cur_node) = reduction_nodes;
-             reduction_nodes = cur_node;
-             ++local_count;
-             ++reduction_count;
-             if (WN_opcode(cur_node) == OPC_PRAGMA)
-               shared_table[shared_count++] = WN_st(cur_node);
+              if (WN_opcode(cur_node) != OPC_PRAGMA &&
+                WN_operator(WN_kid0(cur_node)) == OPR_ARRAY &&
+                OPCODE_has_sym(WN_opcode(WN_kid0(WN_kid0(cur_node)))) == 0) {
+                WN_DELETE_Tree ( cur_node );
+              } else {
+                WN_next(cur_node) = reduction_nodes;
+                reduction_nodes = cur_node;
+               ++local_count;
+               ++reduction_count;
+               if (WN_opcode(cur_node) == OPC_PRAGMA)
+                 shared_table[shared_count++] = WN_st(cur_node);
+              }
            } else
              WN_DELETE_Tree ( cur_node );
            break;

Modified: trunk/osprey/be/lno/minvariant.cxx
===================================================================
--- trunk/osprey/be/lno/minvariant.cxx  2011-10-18 02:23:36 UTC (rev 3766)
+++ trunk/osprey/be/lno/minvariant.cxx  2011-10-18 05:40:35 UTC (rev 3767)
@@ -1190,10 +1190,15 @@
       for (WN* wn = wn_first; wn != NULL; wn = WN_next(wn)) {
         if (WN_opcode(wn) == OPC_XPRAGMA 
          && WN_pragma(wn) == WN_PRAGMA_REDUCTION
-         && WN_operator(WN_kid0(wn)) == OPR_ARRAY 
-         && SYMBOL(WN_array_base(WN_kid0(wn))) 
+         && WN_operator(WN_kid0(wn)) == OPR_ARRAY ) {
+          if (OPCODE_has_sym(WN_opcode(WN_array_base(WN_kid0(wn))))) {
+           if( SYMBOL(WN_array_base(WN_kid0(wn)))
                == SYMBOL(WN_array_base(p->Array))) {
-         return FALSE; 
+               return FALSE;
+            }
+          } else {
+              return FALSE;
+          }
         }
       }
     } 


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to