[HN Gopher] A Compiler Bug (2023)
       ___________________________________________________________________
        
       A Compiler Bug (2023)
        
       Author : pbrowne011
       Score  : 30 points
       Date   : 2024-10-04 16:24 UTC (1 days ago)
        
 (HTM) web link (rsaxvc.net)
 (TXT) w3m dump (rsaxvc.net)
        
       | userbinator wrote:
       | I have, in various projects over the years, resorted to inline
       | Asm when I couldn't coerce the compiler to do exactly what I
       | wanted; including very rare compiler bugs.
        
       | bobmcnamara wrote:
       | Haha! It's ARM compiler 4!
        
       | sligor wrote:
       | Volatile were buggy in old compiler:
       | https://llvm.org/pubs/2008-10-EMSOFT-Volatiles.html [2008 paper]
       | 
       | Even if compilers are better now, if possible it is better to
       | wrap any IO memory access into ioread/iowrite inline (no cost)
       | functions. This can then be implemented in a way known to be safe
       | for the compiler used. And that can be changed easily in case the
       | architecture or the compiler changes ( yeah abstraction ! )
       | 
       | As linux does for example:
       | https://www.kernel.org/doc/html/v4.15/driver-api/device-io.h...
        
       | kookamamie wrote:
       | Searches for "volatile"...ahh, there it is.
        
       | vintagedave wrote:
       | > the compiler vendor took care of it promptly in a paid upgrade
       | to proprietary compiler 5.next
       | 
       | Ouch (assuming that this required them to pay to get the bugfix.)
        
       ___________________________________________________________________
       (page generated 2024-10-05 23:01 UTC)