March 27, 2013 [Issue 4835] DMD should warn about integer overflow in computed constant | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lars Holowko | http://d.puremagic.com/issues/show_bug.cgi?id=4835 --- Comment #10 from Luís Marques <luismarques@gmail.com> 2013-03-26 20:04:13 PDT --- (In reply to comment #9) > (In reply to comment #8) > > https://github.com/D-Programming-Language/dmd/pull/1803 > > An error, even :-) So the issue name should be updated. > > Thank you Walter. Let's see how this patch goes. I hope the feedback I provided with being bitten by this corner case helped nudge this issue to the limelight, that way I can feel slightly important ;-). Thanks for addressing it so quickly Walter. (Also, isn't it strange that this was addressed quicker than in Java, which should have a larger support community, where the issue remains? Go D! (At least it remains with javac 1.6.0_43)) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 27, 2013 [Issue 4835] DMD should warn about integer overflow in computed constant | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lars Holowko | http://d.puremagic.com/issues/show_bug.cgi?id=4835 --- Comment #11 from Walter Bright <bugzilla@digitalmars.com> 2013-03-26 22:36:40 PDT --- While I disagree with bearophile about doing such checks at runtime, due to the performance cost, doing them at compile time is a whole 'nother story. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 27, 2013 [Issue 4835] DMD should warn about integer overflow in computed constant | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lars Holowko | http://d.puremagic.com/issues/show_bug.cgi?id=4835 --- Comment #12 from Luís Marques <luismarques@gmail.com> 2013-03-26 22:46:13 PDT --- (In reply to comment #11) > While I disagree with bearophile about doing such checks at runtime, due to the performance cost, doing them at compile time is a whole 'nother story. Why don't you make the runtime over/underflow checks opt-in? (compiler option). There's a 0 performance cost that way, both for debug and release, by default, so no performance excuse. Then we can always discuss it later if it should be opt-out for the debug builds. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 27, 2013 [Issue 4835] DMD should warn about integer overflow in computed constant | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lars Holowko | http://d.puremagic.com/issues/show_bug.cgi?id=4835 --- Comment #13 from Walter Bright <bugzilla@digitalmars.com> 2013-03-27 02:38:18 PDT --- Because it'll screw things up right and left, for example, address calculations. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 27, 2013 [Issue 4835] DMD should warn about integer overflow in computed constant | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lars Holowko | http://d.puremagic.com/issues/show_bug.cgi?id=4835 --- Comment #14 from bearophile_hugs@eml.cc 2013-03-27 04:00:40 PDT --- (In reply to comment #11) > While I disagree with bearophile about doing such checks at runtime, due to the performance cost, A feature of LLVM 3.3, it seems those costs are not too much large for C language: http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation See: -fsanitize=signed-integer-overflow -fsanitize=integer More info: http://embed.cs.utah.edu/ioc/ -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 27, 2013 [Issue 4835] DMD should warn about integer overflow in computed constant | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lars Holowko | http://d.puremagic.com/issues/show_bug.cgi?id=4835 --- Comment #15 from Luís Marques <luismarques@gmail.com> 2013-03-27 09:00:14 PDT --- (In reply to comment #13) > Because it'll screw things up right and left, for example, address calculations. Walter, what do you mean, screw? Is that a limitation of the dmd backend, or are you arguing that it is problematic in general? LLVM implements it, as bearophile points out... -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 28, 2013 [Issue 4835] DMD should warn about integer overflow in computed constant | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lars Holowko | http://d.puremagic.com/issues/show_bug.cgi?id=4835 --- Comment #16 from Walter Bright <bugzilla@digitalmars.com> 2013-03-28 00:39:03 PDT --- (In reply to comment #15) > Walter, what do you mean, screw? Is that a limitation of the dmd backend, or are you arguing that it is problematic in general? LLVM implements it, as bearophile points out... Consider all the addressing modes used - they are all adds, with no overflow checks. Secondly, they all rely on wraparound (overflow) arithmetic, after all, that is how subtraction is done. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation