|
|
|
|
|
by wat10000
9 days ago
|
|
Because doing so doesn’t change the semantics of the program as defined by the language. If you open the possibility of other notions of “the semantics” besides what the language spec lays out, then changing those semantics is an inherent part of an optimizer. What people (IMO fairly reasonably) want is a different C language spec with less undefined behavior and compilers that follow that spec. But people don’t think about it clearly and skip major parts of that picture when complaining about it. |
|
Many people program for their hardware (what else can be actually tested) or maybe qemu or virtualbox or vmware or a specific external microcontroller.
Very few people want to program for the C abstract machine. The C abstract machine doesn’t even really have dlopen(3). It also has to be compatible with Harvard architecture, von Neumann architecture, two's complement signed machine word integers, one's complement signed machine word integers, and sign-magnitude signed machine word integers.