[Bug 1662495] [NEW] GCC 5 optimizer produces incorrect code

2017-02-07 Thread Egor Suvorov
Public bug reported: Inspired by the following blog post: http://codeforces.com/blog/entry/50291 Attached file is a snippet of code which, when compiled with `g++ a.cpp` produces an executable `a.out`, which runs correctly. But when compiled with `g++ a.cpp -O1` the resulting executable crashes i

[Bug 1662495] Re: GCC 5 optimizer produces incorrect code

2017-02-08 Thread Egor Suvorov
Sidenote: we were unable to reproduce that bug on: 1. Ideone (they claim to use GCC 5.1, but do not specify which flavor it is). 2. tdm-gcc 5.1.0 on Windows. 3. gcc version 6.1.0 (Gentoo 6.1.0 p1.0) And we were able to reproduce it on (in addition to what's mentioned in the report): 1. g++ (Ubunt