[PATCH] ARM: disable GCC SRA optimization

Nathan Lynch Nathan_Lynch at mentor.com
Wed Sep 2 14:17:24 PDT 2015


On 09/02/2015 11:45 AM, Ard Biesheuvel wrote:
> On 2 September 2015 at 18:28, Ard Biesheuvel <ard.biesheuvel at linaro.org> 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 <ard.biesheuvel at linaro.org>
>> ---
>>
>> 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.




More information about the linux-arm-kernel mailing list