Author: fengzhou
Date: 2011-02-24 17:51:04 -0500 (Thu, 24 Feb 2011)
New Revision: 3491

Modified:
   trunk/osprey/be/cg/cgemit.cxx
Log:
Fix bug #713, caused by generating references to file scope static variables 
which are actually put into another file (symtab.I) by IPA.


Modified: trunk/osprey/be/cg/cgemit.cxx
===================================================================
--- trunk/osprey/be/cg/cgemit.cxx       2011-02-24 03:22:37 UTC (rev 3490)
+++ trunk/osprey/be/cg/cgemit.cxx       2011-02-24 22:51:04 UTC (rev 3491)
@@ -6592,8 +6592,18 @@
        fprintf (Asm_File, " %+lld)\n", (INT64) sym_ofst);
       }
       else {
-       EMT_Write_Qualified_Name (Asm_File, sym);
-       fprintf (Asm_File, " %+lld\n", (INT64) sym_ofst);
+          if ( ST_is_export_local(sym) &&
+                  ST_class(sym) == CLASS_VAR &&
+                  ST_level(sym) == GLOBAL_SYMTAB &&
+                  Read_Global_Data) {
+              // we are in IPA mode and we are generating a reference to local 
symbol
+              // that has been merged into global symtab because of IPA
+              EMT_Write_Qualified_Name (Asm_File, basesym);
+              fprintf (Asm_File, " %+lld\n", (INT64) base_ofst);
+          } else {
+              EMT_Write_Qualified_Name (Asm_File, sym);
+              fprintf (Asm_File, " %+lld\n", (INT64) sym_ofst);
+          }
       }
       if (ST_class(sym) == CLASS_FUNC
 #if defined(BUILD_OS_DARWIN)


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