diff options
Diffstat (limited to 'gcc/lto/lto-partition.c')
-rw-r--r-- | gcc/lto/lto-partition.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c index 6055dad99b5..60daafdf375 100644 --- a/gcc/lto/lto-partition.c +++ b/gcc/lto/lto-partition.c @@ -757,7 +757,8 @@ lto_balanced_map (int n_lto_partitions, int max_partition_size) if (npartitions < n_lto_partitions) partition_size = total_size / (n_lto_partitions - npartitions); else - partition_size = INT_MAX; + /* Watch for overflow. */ + partition_size = INT_MAX / 16; if (partition_size < PARAM_VALUE (MIN_PARTITION_SIZE)) partition_size = PARAM_VALUE (MIN_PARTITION_SIZE); |