[Bug tree-optimization/60229] wrong code at -O2 and -O3 on x86_64-linux-gnu

2014-02-17 Thread mikpelinux at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60229 --- Comment #3 from Mikael Pettersson mikpelinux at gmail dot com --- Technically there is an overflow there. But GCC defines conversion to a smaller signed integer type, when the value cannot be represented in that smaller type, as a

[Bug tree-optimization/60229] wrong code at -O2 and -O3 on x86_64-linux-gnu

2014-02-17 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60229 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added CC||jakub at gcc dot

[Bug tree-optimization/60229] wrong code at -O2 and -O3 on x86_64-linux-gnu

2014-02-16 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60229 Andrew Pinski pinskia at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED

[Bug tree-optimization/60229] wrong code at -O2 and -O3 on x86_64-linux-gnu

2014-02-16 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60229 --- Comment #2 from Andrew Pinski pinskia at gcc dot gnu.org --- Note there is no overflow happening here at all. In that a++ is the same as a = a + 1 which is the same as a = (short)(((int)a) + 1) due to promotion rules in C.