public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] lto: set nthreads_var to 1 if it is zero
@ 2020-12-15  9:00 Martin Liška
  2020-12-15  9:05 ` Jakub Jelinek
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Liška @ 2020-12-15  9:00 UTC (permalink / raw)
  To: gcc-patches

This prevents using -j0 on target where we are unable
to detect number of core.

Ready to be installed?
Thanks,
Martin

gcc/ChangeLog:

	PR lto/98275
	* lto-wrapper.c: Do not use -j0 when we are unable to detect
	number of cores.
---
  gcc/lto-wrapper.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index 68ccb156521..da1305c1696 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -1780,6 +1780,8 @@ cont1:
  	{
  	  char buf[256];
  	  init_num_threads ();
+	  if (nthreads_var == 0)
+	    nthreads_var = 1;
  	  if (verbose)
  	    fprintf (stderr, "LTO parallelism level set to %ld\n",
  		     nthreads_var);
-- 
2.29.2


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

* Re: [PATCH] lto: set nthreads_var to 1 if it is zero
  2020-12-15  9:00 [PATCH] lto: set nthreads_var to 1 if it is zero Martin Liška
@ 2020-12-15  9:05 ` Jakub Jelinek
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2020-12-15  9:05 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches

On Tue, Dec 15, 2020 at 10:00:35AM +0100, Martin Liška wrote:
> This prevents using -j0 on target where we are unable
> to detect number of core.
> 
> Ready to be installed?
> Thanks,
> Martin
> 
> gcc/ChangeLog:
> 
> 	PR lto/98275
> 	* lto-wrapper.c: Do not use -j0 when we are unable to detect
> 	number of cores.

Ok.

	Jakub


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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15  9:00 [PATCH] lto: set nthreads_var to 1 if it is zero Martin Liška
2020-12-15  9:05 ` Jakub Jelinek

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).