# DP: Backport the LTO zstd compression support (part 2)

gcc/

2019-07-09  Martin Liska  <mliska@suse.cz>

	* lto-compress.c (lto_normalized_zstd_level): Do not use
	ZSTD_CLEVEL_DEFAULT as it is not default in old releases
	of libzstd.  One can use 0 as a default compression level.

--- a/src/gcc/lto-compress.c
+++ b/src/gcc/lto-compress.c
@@ -115,13 +115,10 @@
 {
   int level = flag_lto_compression_level;
 
-  if (level != ZSTD_CLEVEL_DEFAULT)
-    {
-      if (level < 1)
-	level = 1;
-      else if (level > ZSTD_maxCLevel ())
-	level = ZSTD_maxCLevel ();
-    }
+  if (level < 0)
+    level = 0;
+  else if (level > ZSTD_maxCLevel ())
+    level = ZSTD_maxCLevel ();
 
   return level;
 }
