-O3 is perfectly safe in the absence of UB. And with UB, -O2 and friends can
easily break with new compiler versions and such anyway.

In addition, I'd say that -O/-O1 is probably as risky as -O3 nowadays, if not
more, because if nothing else, you don't get a bunch of hardening.

Signed-off-by: Sam James <s...@gentoo.org>
---
 eclass/flag-o-matic.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 6bec3df308814..3dd39c54a5317 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -47,7 +47,7 @@ setup-allowed-flags() {
 # Note: shell globs and character lists are allowed
 _setup-allowed-flags() {
        ALLOWED_FLAGS=(
-               -pipe -O '-O[12sg]' '-mcpu=*' '-march=*' '-mtune=*'
+               -pipe -O '-O[123sg]' '-mcpu=*' '-march=*' '-mtune=*'
 
                # Hardening flags
                '-fstack-protector*'
-- 
2.40.1


Reply via email to