public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] LTO: fallback to -flto=N if -flto=jobserver does not work.
@ 2021-04-21 11:50 Martin Liška
  2021-04-21 15:11 ` Jeff Law
  2021-04-22  8:04 ` Richard Biener
  0 siblings, 2 replies; 10+ messages in thread
From: Martin Liška @ 2021-04-21 11:50 UTC (permalink / raw)
  To: gcc-patches

When -flto=jobserver is used and we cannot detect job server, then we can
still fallbackto -flto=N mode.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

gcc/ChangeLog:

	* lto-wrapper.c (run_gcc): When -flto=jobserver is used, but the
	makeserver cannot be detected, then use -flto=N fallback.
---
 gcc/lto-wrapper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index 03a5922f8ea..0b626d7c811 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -1585,8 +1585,9 @@ run_gcc (unsigned argc, char *argv[])
       if (jobserver && jobserver_error != NULL)
 	{
 	  warning (0, jobserver_error);
-	  parallel = 0;
+	  /* Fall back to auto parallelism.  */
 	  jobserver = 0;
+	  auto_parallel = 1;
 	}
       else if (!jobserver && jobserver_error == NULL)
 	{
-- 
2.31.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-05-12  9:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21 11:50 [PATCH] LTO: fallback to -flto=N if -flto=jobserver does not work Martin Liška
2021-04-21 15:11 ` Jeff Law
2021-04-22  8:04 ` Richard Biener
2021-04-22  9:02   ` Martin Liška
2021-04-22 11:19     ` Richard Biener
2021-04-22 12:21       ` Martin Liška
2021-04-22 12:47         ` Richard Biener
2021-04-22 14:30           ` Martin Liška
2021-05-12  9:10             ` Martin Liška
2021-05-12  9:21               ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).