Author: shenruifen
Date: 2011-08-22 05:56:36 -0400 (Mon, 22 Aug 2011)
New Revision: 3723

Modified:
   trunk/osprey/be/opt/opt_cfg.cxx
Log:
Fix bug 863 - WOPT: Segmentation fault in Global Optimization -- Create CFG 
phase
http://bugs.open64.net/show_bug.cgi?id=863

Approved by Lai JianXin



Modified: trunk/osprey/be/opt/opt_cfg.cxx
===================================================================
--- trunk/osprey/be/opt/opt_cfg.cxx     2011-08-20 06:09:05 UTC (rev 3722)
+++ trunk/osprey/be/opt/opt_cfg.cxx     2011-08-22 09:56:36 UTC (rev 3723)
@@ -1799,15 +1799,18 @@
     if (WN_prev(WN_last(else_wn)))
       WN_INSERT_BlockFirst(else_block, WN_prev(WN_last(else_wn)));
     else_wn     = else_block;
-    WN_then(wn) = else_block;
+    WN_else(wn) = else_wn;
   }
 
-  if (Screen_cand(wn))
-    return wn_bk;
-
   BOOL empty_then = !then_wn || !WN_first(then_wn);    
   BOOL empty_else = !else_wn || !WN_first(else_wn);
   
+       FmtAssert(!(empty_then && empty_else), 
+              ("Screen_cand: Both then_stmt and else_stmt are NULL"));
+
+  if (Screen_cand(wn))
+    return wn_bk;
+  
   // Get the store from either the first statement of the non-empty block
   WN *stmt = WN_first(empty_then ? else_wn : then_wn);
 


------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to