commit:     3bbf3bd432ec1436bef6e2d7ffc83d1c031553ab
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  5 23:52:26 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Mar  5 23:52:26 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3bbf3bd4

toolchain.eclass: mangle -O3 down to -O2, not -O0

In bug #701786 'strip-flags' removed all unsafe options
first including -O3 and only then mangled -O? to -O2.

This effectively made gcc to compalie wth -O0, generated
huge slow profile and confused LTO.

Let's default to safer -O3->-O2 transition.

Reported-by: jeff.lemos.a <AT> gmail.com
Closes: https://bugs.gentoo.org/701786
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 62520ae92df..d69ce9503ea 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1494,8 +1494,8 @@ downgrade_arch_flags() {
 }
 
 gcc_do_filter_flags() {
+       replace-flags -O? -O2 # 701786 (-O3)
        strip-flags
-       replace-flags -O? -O2
 
        # dont want to funk ourselves
        filter-flags '-mabi*' -m31 -m32 -m64

Reply via email to