[U-Boot] imx: get_ticks in syscounter.c get miscompiled by GCC 6

Yasushi SHOJI yasushi.shoji at gmail.com
Wed Mar 7 05:57:02 UTC 2018


Hi,

On Tue, Mar 6, 2018 at 10:11 PM, Fabio Estevam <festevam at gmail.com> wrote:
> On Tue, Mar 6, 2018 at 9:31 AM, Lothar Waßmann <LW at karo-electronics.de> wrote:
>
>> Without the 'volatile' attribute the compiler is entitled to move the
>> asm code around or optimize it out.
>> So, your patch is the correct fix independent from the gcc version
>> used.
>
> Yes, but then it would be better to fix all the places where asm is
> used without volatile.

That'd be a quite big patch.  A quick grep shows me that
there is over 100 asm() without volatile.

git grep -e '\basm *(' | grep  -v -e volatile -e nop | wc -l
153

Do you guys really want to put volatile on all of these now?
We are at rc4 and Tom is planing to cut the release
March 12th.

I'm attaching a tentative patch to fix only syscounter.c.
If it looks good, I'l resend it by git-send-email.

Best,
-- 
            yashi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-imx-syscounter-make-sure-asm-is-volatile.patch
Type: text/x-patch
Size: 2367 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180307/9aacb871/attachment.bin>


More information about the U-Boot mailing list