Make -flto=jobserver parallel again.

Message ID b0ccfaf1-cd8c-5ad4-f151-f0214a1f54c8@suse.cz
State New
Headers show
Series
  • Make -flto=jobserver parallel again.
Related show

Commit Message

Martin Liška Aug. 23, 2019, 11:02 a.m.
Hi.

As I did quite some changes in the LTO logic, revision
r274232 dropped default value of parallel back to 0.
Doing that, I forgot to set it to 1 at the places where
jobserver is detected.

I tested that LTO bootstrap is parallel again.

Ready to be installed?
Thanks,
Martin

gcc/ChangeLog:

2019-08-23  Martin Liska  <mliska@suse.cz>

	* lto-wrapper.c (run_gcc): When setting jobserver
	set also parallel to 1.  This was done so before r273908.
---
 gcc/lto-wrapper.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Comments

Richard Biener Aug. 23, 2019, 11:25 a.m. | #1
On Fri, Aug 23, 2019 at 1:02 PM Martin Liška <mliska@suse.cz> wrote:
>

> Hi.

>

> As I did quite some changes in the LTO logic, revision

> r274232 dropped default value of parallel back to 0.

> Doing that, I forgot to set it to 1 at the places where

> jobserver is detected.

>

> I tested that LTO bootstrap is parallel again.

>

> Ready to be installed?


OK.

Richard.

> Thanks,

> Martin

>

> gcc/ChangeLog:

>

> 2019-08-23  Martin Liska  <mliska@suse.cz>

>

>         * lto-wrapper.c (run_gcc): When setting jobserver

>         set also parallel to 1.  This was done so before r273908.

> ---

>  gcc/lto-wrapper.c | 12 +++++++++---

>  1 file changed, 9 insertions(+), 3 deletions(-)

>

>

Patch

diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index 68f63da910f..75ed289f3f2 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -1374,7 +1374,10 @@  run_gcc (unsigned argc, char *argv[])
 
 	case OPT_flto_:
 	  if (strcmp (option->arg, "jobserver") == 0)
-	    jobserver = 1;
+	    {
+	      parallel = 1;
+	      jobserver = 1;
+	    }
 	  else if (strcmp (option->arg, "auto") == 0)
 	    {
 	      parallel = 1;
@@ -1423,8 +1426,11 @@  run_gcc (unsigned argc, char *argv[])
       auto_parallel = 0;
       parallel = 0;
     }
-  else if (!jobserver)
-    jobserver = jobserver_active_p ();
+  else if (!jobserver && jobserver_active_p ())
+    {
+      parallel = 1;
+      jobserver = 1;
+    }
 
   if (linker_output)
     {