Author: dgilmore
Date: 2010-12-10 19:25:34 -0500 (Fri, 10 Dec 2010)
New Revision: 3431

Modified:
   trunk/osprey/ipa/common/ipc_compile.cxx
Log:
When IPA tracing/logging is enabled, at the end of the "compile"
the following message would sometimes appear:

/bin/sh: line 0: [: a.out.ipakeep/1.t: binary operator expected

Also there is a small semantic change that is described in a comment included
the change that fixes this problem in the saving of trace/log files.

Approved by Sun.


Modified: trunk/osprey/ipa/common/ipc_compile.cxx
===================================================================
--- trunk/osprey/ipa/common/ipc_compile.cxx     2010-12-09 23:55:41 UTC (rev 
3430)
+++ trunk/osprey/ipa/common/ipc_compile.cxx     2010-12-11 00:25:34 UTC (rev 
3431)
@@ -1049,16 +1049,24 @@
     bool t_enabled = TFile != stdout;
 
     if (tlogs_enabled) {
-      fprintf(makefile, "\tif [ -f %s/*.tlog ] ; then ",
+      fprintf(makefile, "\tif 'ls' -f %s/*.tlog > /dev/null 2>&1 ; then ",
               tmpdir);
-      fprintf(makefile, "'cat' %s/*.tlog >> %s.tlog ; true ; fi\n",
-              tmpdir, executable);
+      // Beforehand the output of cat was appended to
+      // <executable>.<log>, but this requires the user to remove
+      // <executable>.t before invocation when there is no
+      // <executable>.<suffix> source file.  But we don't want to just
+      // truncate <executable>.<log> before writing, since
+      // <executable>.<log> might be created during input WHIRL
+      // generation.  So we truncate and write to <tmpdir>.log
+      // instead.
+      fprintf(makefile, "'cat' %s/*.tlog > %s.tlog ; true ; fi\n",
+              tmpdir, tmpdir);
     }
     if (t_enabled) {
-      fprintf(makefile, "\tif [ -f %s/*.t ] ; then ",
+      fprintf(makefile, "\tif 'ls' -f %s/*.t > /dev/null 2>&1 ; then ",
               tmpdir);
-      fprintf(makefile, "'cat' %s/*.t >> %s.t ; true ; fi\n",
-              tmpdir, executable);
+      fprintf(makefile, "'cat' %s/*.t > %s.t ; true ; fi\n",
+              tmpdir, tmpdir);
     }
   }
   else {


------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
Open64-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to