[Bug c++/118033] [Missing optimization] Keep __builtin_unreachable for asserts in the release build

2024-12-13 Thread dmitriy.ovdienko at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118033 --- Comment #3 from Dmytro Ovdiienko --- I believe in 99% cases whatever is passed to the assert() is a legal expression that returns bool. And there is an opportunity to optimize the output assembly in case we if want to reuse that expression f

[Bug c++/118033] [Missing optimization] Keep __builtin_unreachable for asserts in the release build

2024-12-13 Thread dmitriy.ovdienko at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118033 --- Comment #1 from Dmytro Ovdiienko --- I'm not sure about how to handle the side effects caused by the expression. The code in the expression must not be executed but used by the compiler only for the optimization.

[Bug c++/118033] New: [Missing optimization] Keep __builtin_unreachable for asserts in the release build

2024-12-13 Thread dmitriy.ovdienko at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118033 Bug ID: 118033 Summary: [Missing optimization] Keep __builtin_unreachable for asserts in the release build Product: gcc Version: 14.2.0 Status: UNCONFIRMED Sev

[Bug c++/109127] New: More advanced constexpr value compile time evaluation

2023-03-14 Thread dmitriy.ovdienko at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109127 Bug ID: 109127 Summary: More advanced constexpr value compile time evaluation Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Com

[Bug c++/98840] Why does baz call the delete operator for moved unique_ptr

2021-01-26 Thread dmitriy.ovdienko at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98840 --- Comment #4 from Dmitriy Ovdienko --- What if introduce new ABI version and encode into function name (function name mangling). And then have two options: * Either compile code and store both versions into lib file (ABI v1 and v2). Applies

[Bug c++/98840] Why does baz call the delete operator for moved unique_ptr

2021-01-26 Thread dmitriy.ovdienko at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98840 --- Comment #3 from Dmitriy Ovdienko --- > This is not a GCC bug. No it is not. But can we improve that? That approach increases the binary size. In case if `baz` is called from many places, that is going to increase the binary size.

[Bug c++/98840] New: Why does baz call the delete operator for moved unique_ptr

2021-01-26 Thread dmitriy.ovdienko at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98840 Bug ID: 98840 Summary: Why does baz call the delete operator for moved unique_ptr Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Pr

[Bug c++/97641] Wrong codegen if optimizer is enabled

2020-10-30 Thread dmitriy.ovdienko at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97641 --- Comment #7 from Dmitriy Ovdienko --- If I change the body of the loop like this, it also works ``` while ('\x01' != *ptr) { result = result * 10 - '0' + *ptr++; } ``` Looks like integer overflow happens on last iteration and compiler

[Bug c++/97641] Wrong codegen if optimizer is enabled

2020-10-30 Thread dmitriy.ovdienko at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97641 --- Comment #6 from Dmitriy Ovdienko --- This code does not work ``` #include int Parse1(char const* ptr) noexcept { int result = 0; while ('\x01' != *ptr) { result = result * 10 + *ptr++ - '0'; } return result; } i

[Bug c++/97641] Wrong codegen if optimizer is enabled

2020-10-30 Thread dmitriy.ovdienko at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97641 Dmitriy Ovdienko changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALI

[Bug c++/97641] Wrong codegen if optimizer is enabled

2020-10-30 Thread dmitriy.ovdienko at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97641 --- Comment #4 from Dmitriy Ovdienko --- It happens to 2147483646, 2147483647 and std::numeric_limits::min().

[Bug c++/97641] Wrong codegen if optimizer is enabled

2020-10-30 Thread dmitriy.ovdienko at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97641 --- Comment #1 from Dmitriy Ovdienko --- OS: Windows 10 Distribution: MSys2 (https://www.msys2.org/) Version: (Rev4, Built by MSYS2 project) 10.2.0 I tried to reproduce this issue on https://gcc.godbolt.org/. gcc (trunk) is also unable to compil

[Bug c++/97641] New: Wrong codegen if optimizer is enabled

2020-10-30 Thread dmitriy.ovdienko at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97641 Bug ID: 97641 Summary: Wrong codegen if optimizer is enabled Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++