<p>Ideas for bisecting, as you said it changes with optimization</p>
<ul>
<li>did you compare the generated low level code to find the difference ?</li>
<li>does it also crash when compiling only the low level with optimization (by manually adding CFLAGS in the module Makefile)</li>
</ul>
<p>Note as I just thought about it, if there is re-ordering, a memory barrier may be necessary <code>__asm__ volatile ("" : : : "memory");</code><br>
It was the case in <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="319980187" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/9068" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/9068/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/9068">#9068</a> where waiting on a variable was ignored. It was solved through a function call instead of the mem barrier there.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/issues/11820?email_source=notifications&email_token=ABE7WYBRUQ6CMMLFH4AUZG3P6TBMFA5CNFSM4H7EJQMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZQ5OJI#issuecomment-509728549">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYA4UGQV5UX6KPCZRPDP6TBMFANCNFSM4H7EJQMA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYHVSA5LGPGVNZM7OZDP6TBMFA5CNFSM4H7EJQMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZQ5OJI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/issues/11820?email_source=notifications\u0026email_token=ABE7WYBRUQ6CMMLFH4AUZG3P6TBMFA5CNFSM4H7EJQMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZQ5OJI#issuecomment-509728549",
"url": "https://github.com/RIOT-OS/RIOT/issues/11820?email_source=notifications\u0026email_token=ABE7WYBRUQ6CMMLFH4AUZG3P6TBMFA5CNFSM4H7EJQMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZQ5OJI#issuecomment-509728549",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>