From: Jakub Jelinek <jakub@redhat.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
James Morris <james.l.morris@oracle.com>,
Richard Biener <rguenther@suse.de>,
Jakub Jelinek <jakub@gcc.gnu.org>,
"David S. Miller" <davem@davemloft.net>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra
Date: Wed, 20 Dec 2017 22:46:48 +0100 [thread overview]
Message-ID: <20171220214648.GO2353@tucnak> (raw)
In-Reply-To: <20171220205213.1025257-1-arnd@arndb.de>
On Wed, Dec 20, 2017 at 09:52:05PM +0100, Arnd Bergmann wrote:
> diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c
> index ca554d57d01e..35f973ba9878 100644
> --- a/crypto/aes_generic.c
> +++ b/crypto/aes_generic.c
> @@ -1331,6 +1331,20 @@ EXPORT_SYMBOL_GPL(crypto_aes_set_key);
> f_rl(bo, bi, 3, k); \
> } while (0)
>
> +#if __GNUC__ >= 7
> +/*
> + * Newer compilers try to optimize integer arithmetic more aggressively,
> + * which generally improves code quality a lot, but in this specific case
> + * ends up hurting more than it helps, in some configurations drastically
> + * so. This turns off two optimization steps that have been shown to
> + * lead to rather badly optimized code with gcc-7.
> + *
> + * See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83356
> + */
> +#pragma GCC optimize("-fno-tree-pre")
> +#pragma GCC optimize("-fno-tree-sra")
So do it only when UBSAN is enabled? GCC doesn't have a particular
predefined macro for those (only for asan and tsan), but either the kernel
does have something already, or could have something added in the
corresponding Makefile.
Jakub
next prev parent reply other threads:[~2017-12-20 21:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-20 20:52 [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra Arnd Bergmann
2017-12-20 21:14 ` Ard Biesheuvel
2017-12-20 21:31 ` Arnd Bergmann
2017-12-20 21:46 ` Jakub Jelinek [this message]
2017-12-21 10:20 ` Arnd Bergmann
2017-12-21 12:22 ` Ard Biesheuvel
2017-12-21 13:47 ` PrasannaKumar Muralidharan
2017-12-22 15:47 ` Ard Biesheuvel
2018-01-03 16:37 ` Arnd Bergmann
2018-01-03 17:36 ` Ard Biesheuvel
2018-01-03 20:38 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171220214648.GO2353@tucnak \
--to=jakub@redhat.com \
--cc=ard.biesheuvel@linaro.org \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=jakub@gcc.gnu.org \
--cc=james.l.morris@oracle.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rguenther@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox