lto: set nthreads_var to 1 if it is zero
authorMartin Liska <mliska@suse.cz>
Tue, 15 Dec 2020 08:59:04 +0000 (09:59 +0100)
committerMartin Liska <mliska@suse.cz>
Tue, 15 Dec 2020 09:07:37 +0000 (10:07 +0100)
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

index 68ccb1565219a4c0ec6adf54778182358252a792..da1305c1696528c661164e73d03752a440fe016c 100644 (file)
@@ -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);