diff options
author | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-07-29 19:26:15 -0300 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-07-29 19:26:15 -0300 |
commit | e4c5fbf07b3aec4c896b4eaafeb9f34cea97bb56 (patch) | |
tree | 3fec7ea428e44199866f9b1f1d61b109000ee5c7 /gcc | |
parent | cbc80292ec99d1b6f10f2ce7e2c60603a6b98260 (diff) | |
download | gcc-e4c5fbf07b3aec4c896b4eaafeb9f34cea97bb56.zip gcc-e4c5fbf07b3aec4c896b4eaafeb9f34cea97bb56.tar.gz gcc-e4c5fbf07b3aec4c896b4eaafeb9f34cea97bb56.tar.bz2 |
Avoid crash due to division by zero
An small bug in previous commit could lead to a crash when jobserver
is active. This commit fixes it.
gcc/ChangeLog
2020-07-29 Giuliano Belinassi <giuliano.belinassi@usp.br>
* cgraphunit.c (lto_merge_comdat_map): Avoid crash due to
division by zero.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cgraphunit.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 82462f2..e79d480 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2020-07-29 Giuliano Belinassi <giuliano.belinassi@usp.br> + * cgraphunit.c (lto_merge_comdat_map): Avoid crash due to + division by zero. + +2020-07-29 Giuliano Belinassi <giuliano.belinassi@usp.br> + * lto-partition.c (balance_partitions): Accept number of jobs as argument. diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 58ec25c..a5d5b86 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -2806,6 +2806,9 @@ static bool maybe_compile_in_parallel (void) return false; } + if (jobserver) + num_jobs = 2; + if (num_jobs == 0) { inform (UNKNOWN_LOCATION, "-fparallel-jobs=0 makes no sense"); |