Author: laijx
Date: 2011-02-23 22:22:37 -0500 (Wed, 23 Feb 2011)
New Revision: 3490

Modified:
   trunk/osprey/be/opt/opt_htable_emit.cxx
Log:
Fix an segmentation fault in WHIRL SSA in compiling openmp case. When a
PU is created by BE (like openmp parallel region), the WHIRL_SSA_MANAGER
pointer is NULL for this BE. We need to create a new one before using
it.

CR by Sun.


Modified: trunk/osprey/be/opt/opt_htable_emit.cxx
===================================================================
--- trunk/osprey/be/opt/opt_htable_emit.cxx     2011-02-22 18:12:09 UTC (rev 
3489)
+++ trunk/osprey/be/opt/opt_htable_emit.cxx     2011-02-24 03:22:37 UTC (rev 
3490)
@@ -415,7 +415,16 @@
 
   // WHIRL SSA
   if (OPT_Enable_WHIRL_SSA) {
-    WSSA::WHIRL_SSA_MANAGER *wssa_mgr = PU_Info_ssa_ptr(Current_PU_Info);
+    WSSA::WHIRL_SSA_MANAGER *wssa_mgr = NULL;
+    if (PU_Info_state(Current_PU_Info, WT_SSA) == Subsect_InMem) {
+      wssa_mgr = PU_Info_ssa_ptr(Current_PU_Info);
+    }
+    else {
+      wssa_mgr = new WSSA::WHIRL_SSA_MANAGER(MEM_pu_nz_pool_ptr);
+      Set_PU_Info_ssa_ptr(Current_PU_Info, wssa_mgr);
+      Set_PU_Info_state(Current_PU_Info, WT_SSA, Subsect_InMem);
+    }
+
     _wssa_emitter = CXX_NEW(WHIRL_SSA_EMITTER(wssa_mgr, _opt_stab, 
                                               _wn_to_cr_map), _mem_pool);
     // dump code rep and SSA tree before emitter.


------------------------------------------------------------------------------
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