summaryrefslogtreecommitdiff
path: root/gcc/lto-wrapper.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-15 14:50:25 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-15 14:50:25 +0000
commit4fe86c664f4ce5a8dfe6ab4c9845d07302dff7b8 (patch)
tree6c48720d70dd823a0ad924b247e1e048ec0e16f2 /gcc/lto-wrapper.c
parentcec66ad2395f800263b100eb3d8b6841172c5b72 (diff)
downloadgcc-4fe86c664f4ce5a8dfe6ab4c9845d07302dff7b8.tar.gz
2011-12-15 Richard Guenther <rguenther@suse.de>
* lto-wrapper.c (run_gcc): In non-parallel mode remove ltrans inputs immediately after processing them. In parallel mode truncate the ltrans inputs in the make rule that processes them if temporary files are not to be preserved. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182370 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-wrapper.c')
-rw-r--r--gcc/lto-wrapper.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index 5fb37624810..1cc7bfb843d 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -811,9 +811,19 @@ cont:
for (j = 1; new_argv[j] != NULL; ++j)
fprintf (mstream, " '%s'", new_argv[j]);
fprintf (mstream, "\n");
+ /* If we are not preserving the ltrans input files then
+ truncate them as soon as we have processed it. This
+ reduces temporary disk-space usage. */
+ if (! debug)
+ fprintf (mstream, "\t@-touch -r %s %s.tem > /dev/null 2>&1 "
+ "&& mv %s.tem %s\n",
+ input_name, input_name, input_name, input_name);
}
else
- fork_execute (CONST_CAST (char **, new_argv));
+ {
+ fork_execute (CONST_CAST (char **, new_argv));
+ maybe_unlink_file (input_name);
+ }
output_names[i] = output_name;
}
@@ -851,12 +861,13 @@ cont:
collect_wait (new_argv[0], pex);
maybe_unlink_file (makefile);
makefile = NULL;
+ for (i = 0; i < nr; ++i)
+ maybe_unlink_file (input_names[i]);
}
for (i = 0; i < nr; ++i)
{
fputs (output_names[i], stdout);
putc ('\n', stdout);
- maybe_unlink_file (input_names[i]);
free (input_names[i]);
}
nr = 0;