4 ms·
As long as the option -foverflow=undefined is kept around, you have my vote. Now, it's just a simple matter of programming ;)
by cygx 11y ago
As long as the option -foverflow=undefined is kept around, you have my vote. Now, it's just a simple matter of programming ;)
- derefr 11y agoI think the equivalent for the current practice would basically be: 1. setting "-foverflow=promote" on the compiler's parsing-and-IR-generating stage, thus generating code that acts like all integers occupy infinitely-sized abstract machine registers, and expects this to get shimmed as checked promotion to pointers-to-structs from a bignum library on most architectures; and then, seperately, 2. setting an optimization flag like "-Onopromote" for the target-recompilation stage, that throws away all the bignum promotion shims that would have been inserted, and pretends that it's adhering to bignum-promotion semantics anyway (thus creating code that will be optimized the way C code currently is.) That's quite a bit more complicated, but also a lot more explicit about what's going on: you have to specify (or pick a profile that specifies) the actual semantics you want, and then you have to explicitly opt into assuming those semantics rather than enforcing them. There'd probably be a similar pair of {semantic, assumption} flags for each currently-undefined behavior.