[Bug c/69612] Optimizer does not consider overflow

2016-02-02 Thread roarl at pvv dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69612 --- Comment #2 from Roar Lauritzsen --- Thanks a lot for the quick analysis. Now that I know what it is I can fix my program, and the -fsanitize=undefined will come in handy for localizing problem areas. For future googlers, I am planning to fix

[Bug c/69612] New: Optimizer does not consider overflow

2016-02-01 Thread roarl at pvv dot org
Assignee: unassigned at gcc dot gnu.org Reporter: roarl at pvv dot org Target Milestone: --- I found a short code snippet that produces different results after optimizing with -O2. I believe my code should work as it only uses a simple test to check if incrementation has overflowed. It