4 ms·
> No, you're talking about all signed addition. No, I'm talking about the ones that won't overflow. Some can be statically shown to not need a runtime check.
by jjnoakes 10y ago
> No, you're talking about all signed addition.
No, I'm talking about the ones that won't overflow. Some can be statically shown to not need a runtime check.
> If you're dependent on GCC/clang extensions to C, then you're not compiling to C.
I'm not saying that. I'm saying require either the target compiler (which the user is in control of) to provide a flag to give signed overflow the proper semantics (which would be useful if the user happens to be using clang or gcc), or fall back to requiring some asm for the target system which provides the needed semantics.
This would all be up to someone to configure for the target machine. Not a big deal once per architecture.
> At that point there's no benefit over just compiling to GIMPLE or LLVM in the first place.
Well if GIMPLE or LLVM was available for all of the targets that C compilers are, then I'd agree.
But they aren't. So I don't.