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

Reply via email to