4 ms·
MIPS has arithmetic instructions which trap on overflow. And guess what - gcc & clang use variants which DO NOT trap on overflow.
by Marat_Dukhan 11y ago
MIPS has arithmetic instructions which trap on overflow. And guess what - gcc & clang use variants which DO NOT trap on overflow.
- twoodfin 11y agoWhy? If I had to guess, it's because there's more than a little C code out in the wild that relies on "typical" signed overflow behavior.
- renox 11y agoI don't know: both compilers are trying to use 'undefined use' to optimize code (and too bad for you if this create problems for your application), so your explanation isn't coherent.. My explanation is: lack of interest/money: security is the thing that is always ignored, see the lack of funding of OpenSSL until recently..
- renox 11y agohas or had? I think that some MIPS variant deprecated the trap on overflow, if this is the case then gcc & clang behaviour is logical if not then it's un-comprehensible (especially since at the same time they justify f.. up your executable for 'optimisation' purpose if you have an undefined in your code).
- Marat_Dukhan 11y agoForms with immediate operands were removed in MIPS Release 6, but the register-register forms are still there.