[riot-notifications] [RIOT-OS/RIOT] cpu/arm7_common: Make irq_*() compiler barriers (#11440)

Kaspar Schleiser notifications at github.com
Thu Apr 25 10:28:38 CEST 2019


kaspar030 commented on this pull request.



>      return retval;
 }
 
 int irq_is_in(void)
 {
     int retval;
-    __asm__ volatile(" mrs  %0, cpsr" : "=r"(retval) : /* no inputs */);
+    __asm__ volatile(" mrs  %0, cpsr" : "=r"(retval) : /* no inputs */ : "memory");

> could be transformed into:

Uff, is the compiler allowed to do this? Do you have a reference?

For local variables, that transformation wouldn't matter. This would only affect accesses to global variables (or writes through pointers).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11440#discussion_r278444776
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190425/76927645/attachment.html>


More information about the notifications mailing list