[Bug target/93243] misoptimization: minor changes of the code leads change up to +/- 30% performance on x86_64, -Os faster than -Ofast/O2/O3

2020-01-15 Thread leo at yuriev dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93243 --- Comment #5 from Leo Yuriev --- Created attachment 47658 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47658=edit testcase makefile

[Bug target/93243] misoptimization: minor changes of the code leads change up to +/- 30% performance on x86_64, -Os faster than -Ofast/O2/O3

2020-01-15 Thread leo at yuriev dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93243 --- Comment #4 from Leo Yuriev --- Created attachment 47657 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47657=edit testcase source code

[Bug target/93243] misoptimization: minor changes of the code leads change up to +/- 30% performance on x86_64, -Os faster than -Ofast/O2/O3

2020-01-15 Thread leo at yuriev dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93243 --- Comment #3 from Leo Yuriev --- > (a) < (b) is not equal to ((a) - (b) < 0) > Compiler will trait them differently. Yes, of course. Moreover, in the second case, correct sorting requires limiting the range of keys to avoid overflow when

[Bug target/93243] misoptimization: minor changes of the code leads change up to +/- 30% performance on x86_64, -Os faster than -Ofast/O2/O3

2020-01-12 Thread crazylht at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93243 --- Comment #2 from Hongtao.liu --- > The diffs in the source code are: > #if CASE & 1 > #define CMP(a, b) ((a) < (b)) > #else > #define CMP(a, b) (((a) - (b)) < 0) > #endiF > (a) < (b) is not equal to ((a) - (b) < 0) Compiler will trait them