This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [lto] PATCH: add LTRANS driver


Ollie Wild wrote:

@@ -338,7 +338,7 @@ Objective-C and Objective-C++ Dialects}.
 -fira-coalesce -fno-ira-share-save-slots @gol
 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
--floop-block -floop-interchange -floop-strip-mine -fltrans @gol
+-floop-block -floop-interchange -floop-strip-mine -fltrans -fltrans-driver@gol

Space before @gol.


+@item -fltrans-driver=@var{driver}
+@opindex fltrans-driver
+This option specifies an executable to drive the LTO local transformation
+(LTRANS) mode. When the LTO front end runs in WPA mode (See @option{-fwpa}.),
+it writes new object files and then executes the LTRANS driver. The driver is
+passed a list of object file names, and the CC and CFLAGS environment
+variables are initialized with the compiler driver and flags used to
+initiate WPA. For each input file suffixed with .o, the driver must generate a

s/WPA/LTRANS/


+  char *q;
+
+  /* The following code initializes ltrans_driver to its default value.
+     We don't necessarily know where we're installed, but lto1 and ltans-driver
+     should be in the same directory.  If argv[0] contains the full path to
+     lto1, use it.  Otherwise, we assume ltrans-driver is reachable via the
+     PATH environment variable.  */

How about forcing ltrans-driver to be specified with an absolute path? Though we do allow other utilities (ld, as) to be findable via PATH, so I guess it's not important.


+#include <sys/mman.h>
+

Maybe move the comment from the ChangeLog entry here? Describe what macros were affected for future reference.


+	if (needed > len)
+	  {
+	    len = needed;
+	    temp_filename = XRESIZEVEC (char, temp_filename, len);
+	  }
+	needed = snprintf (temp_filename, len, "bogus%d.lto.o", i);

Maybe choose a filename with tempnam() or some other scheme? This can wait for later, though.



+# Remove the temporary directory on exit or if a SIGTERM or SIGINT is received.
+trap 'rm -rf $tmp' TERM INT EXIT

We will want to optionally keep all this when dealing with bugs. Perhaps, triggering this with -save-temps? This is also for a follow-up patch.


The patch looks OK, otherwise.


Diego.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]