[Issue 24411] [CODEGEN] bad shl codegen

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 27 11:37:09 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24411

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dkorpel at live.nl
         Resolution|---                         |INVALID

--- Comment #3 from Dennis <dkorpel at live.nl> ---
The key here is that it's specified as "implementation defined behavior", not
"undefined behavior". It could give a bogus integer and lead to logic bugs, but
it can't result in memory corruption in `@safe` code. D's 'safety' is
specifically targeting memory safety, not logic bugs in general (e.g.
unintentional integer overflow). It's still a systems programming language with
similar performance to C. Introducing bounds checks to shift expressions is a
big performance hit, especially considering shifts are usually found in
bit-twiddling performance sensitive code.

--


More information about the Digitalmars-d-bugs mailing list