From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan_Lynch@mentor.com (Nathan Lynch) Date: Wed, 2 Sep 2015 16:17:24 -0500 Subject: [PATCH] ARM: disable GCC SRA optimization In-Reply-To: References: <1441211290-11449-1-git-send-email-ard.biesheuvel@linaro.org> Message-ID: <55E76764.2020200@mentor.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 09/02/2015 11:45 AM, Ard Biesheuvel wrote: > On 2 September 2015 at 18:28, Ard Biesheuvel wrote: >> This is a known but as yet unresolved issue. >> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932). In this particular >> case, it is causing the second while loop to be executed erroneously a >> single time, causing the additional space characters to be printed. >> >> So disable the optimization by passing -fno-ipa-sra. >> >> Signed-off-by: Ard Biesheuvel >> --- >> >> Needs to go to stable perhaps? >> The emitted asm is at the end of this patch. >> > > Another report of the same issue: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66271 Comments in both bugs indicate that this happens only when building with -Os and not -O2. Have you (or anyone else) been able to get bad code with -O2? I don't think the answer should affect the patch itself, but it might be kind to note in the commit message whether -Os definitely makes the difference here, if this information is known.