public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/98275] New: -flto=auto fails if nthreads_var is zero, must not pass -j0
@ 2020-12-14 13:55 pexu@gcc-bugzilla.mail.kapsi.fi
  2020-12-14 16:15 ` [Bug lto/98275] " marxin at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pexu@gcc-bugzilla.mail.kapsi.fi @ 2020-12-14 13:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98275

            Bug ID: 98275
           Summary: -flto=auto fails if nthreads_var is zero, must not
                    pass -j0
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pexu@gcc-bugzilla.mail.kapsi.fi
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---
              Host: mingw64

Hi. 

When using `-flto=auto' if the number of threads is not detected, i.e.
`nthreads_var' equals to zero, lto-wrapper must not pass -j0 to GNU make as -j
expects a positive, non-zero integer (if any given).

>From GNU make manual: ``If the ‘-j’ option is followed by an integer, this is
the number of recipes to execute at once; this is called the number of job
slots. If there is nothing looking like an integer after the ‘-j’ option, there
is no limit on the number of job slots.''.

gcc/lto-wrapper.c:
2001               snprintf (jobs, 31, "-j%ld",
2002                         auto_parallel ? nthreads_var : parallel);

$ make -j0
make: the '-j' option requires a positive integer argument

Tried GNU make 4.2.1 (2016 vintage) and 4.2.93 (2020).  For the latest trunk
argument parsing happens at src/main.c around line 2961 [1];  It basically does
``int i = atoi(arg); if (i < 1 || not-all-chars-are-digits) { handle-bad-arg
}''.


[1] https://git.savannah.gnu.org/cgit/make.git/tree/src/main.c#n2961

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14 13:55 [Bug lto/98275] New: -flto=auto fails if nthreads_var is zero, must not pass -j0 pexu@gcc-bugzilla.mail.kapsi.fi
2020-12-14 16:15 ` [Bug lto/98275] " marxin at gcc dot gnu.org
2020-12-15  9:07 ` cvs-commit at gcc dot gnu.org
2020-12-15  9:10 ` marxin at gcc dot gnu.org
2020-12-15 10:12 ` pexu@gcc-bugzilla.mail.kapsi.fi

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