[Bug gcov-profile/114851] Alternative to -Wmisexpect from LLVM in GCC

2024-04-25 Thread zamazan4ik at tut dot by via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114851 --- Comment #3 from Alexander Zaitsev --- > Though I do wonder if the "hints" are used instead of the PGO here. We already discussed this question a bit in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112806 . If I understand correctly, no

[Bug gcov-profile/114851] New: Alternative to -Wmisexpect from LLVM in GCC

2024-04-25 Thread zamazan4ik at tut dot by via Gcc-bugs
: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- LLVM infrastructure supports a diagnostic for checking mismatches between user-provided __builtin_expect/[[likely]] hints and PGO profiles: https://clang.llvm.org/docs

[Bug tree-optimization/114761] Ignored [[likely]] attribute with multiple if statements doing the same thing

2024-04-18 Thread zamazan4ik at tut dot by via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114761 --- Comment #5 from Alexander Zaitsev --- > Is this based on real code or you just was looking at the differences between > gcc and clang here? Really, not on a real code. I came up with this example when I found that GCC for this example

[Bug tree-optimization/114761] New: Ignored [[likely]] attribute

2024-04-17 Thread zamazan4ik at tut dot by via Gcc-bugs
-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- For the following code: bool foo(int var) { if (var == 42) [[unlikely]] return true; if (var == 322) [[unlikely]] return true; if (var == 1337) [[likely]] return

[Bug gcov-profile/112829] Dump PGO profiles to a memory buffer

2023-12-03 Thread zamazan4ik at tut dot by via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112829 --- Comment #2 from Alexander Zaitsev --- Am I right that right now in GCC there are no ready-to-use alternatives to "int __llvm_profile_write_buffer(char *Buffer)" from LLVM and it should be implemented somehow manually (as you described)?

[Bug gcov-profile/112829] New: Dump PGO profiles to a memory buffer

2023-12-02 Thread zamazan4ik at tut dot by via Gcc-bugs
-profile Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by CC: marxin at gcc dot gnu.org Target Milestone: --- According to the GCC documentation (https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html) the only option is to dump

[Bug gcov-profile/112806] Profile-Guided Optimization (PGO) policy regarding explicit user optimization hint behavior

2023-12-01 Thread zamazan4ik at tut dot by via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112806 --- Comment #3 from Alexander Zaitsev --- > https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/Other-Builtins.html#index-fprofile-arcs-1 I already read this and still do not understand the actual behavior. If PGO profiles show that the branch is

[Bug gcov-profile/112717] .gcda profiles compatibility guarantees between GCC versions

2023-11-26 Thread zamazan4ik at tut dot by via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112717 --- Comment #3 from Alexander Zaitsev --- > I thought this was documented but I don't see. There is no guarantee for > forward or backwards compatibility at all. In fact iirc there is a version > stored in the files to make sure the correct

[Bug gcov-profile/112717] New: .gcda profiles compatibility guarantees between GCC versions

2023-11-26 Thread zamazan4ik at tut dot by via Gcc-bugs
Priority: P3 Component: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by CC: marxin at gcc dot gnu.org Target Milestone: --- Hi. I have several questions regarding .gcda profiles re-usage between GCC versions

[Bug other/112492] New: Add LLVM BOLT support to the GCC build scripts

2023-11-12 Thread zamazan4ik at tut dot by via Gcc-bugs
Component: other Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- Hi! According to the Facebook Research Paper (https://research.facebook.com/publications/bolt-a-practical-binary-optimizer-for-data-centers-and-beyond/), LLVM BOLT (https

[Bug c++/96821] [concepts] Incorrect evaluation of concept with ill-formed expression

2021-05-09 Thread zamazan4ik at tut dot by via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96821 Alexander Zaitsev changed: What|Removed |Added CC||zamazan4ik at tut dot

[Bug tree-optimization/91540] Missed optimization: simplification CFG

2019-08-24 Thread zamazan4ik at tut dot by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91540 --- Comment #1 from Alexander Zaitsev --- Godbolt playground: https://godbolt.org/z/MFSH1D

[Bug tree-optimization/91540] New: Missed optimization: simplification CFG

2019-08-24 Thread zamazan4ik at tut dot by
-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- For the code below: int Test(bool cond1, bool cond2) { if (cond1) { if (cond2) { return 42; } } return 43; } gcc

[Bug tree-optimization/91250] Missed optimization: is not used vfnmsub213ss

2019-07-24 Thread zamazan4ik at tut dot by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91250 --- Comment #2 from Alexander Zaitsev --- But on this example all is fine: float foo(float a, float b, float c) { return -a * -b - c; }

[Bug tree-optimization/91250] Missed optimization: is not used vfnmsub213ss

2019-07-24 Thread zamazan4ik at tut dot by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91250 --- Comment #1 from Alexander Zaitsev --- Another example of missed optimization: float foo(float a, float b, float c) { return -a * b - c; }

[Bug tree-optimization/91250] New: Missed optimization: is not used vfnmsub213ss

2019-07-24 Thread zamazan4ik at tut dot by
: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- For this code: float foo(float a, float b, float c) { return a * -b - c; } gcc(trunk) with '-O3 -ffast-math -march=haswell' produces this: foo(float

[Bug tree-optimization/91249] New: Missed optimization: division and multiplying ops in ffast-math mode

2019-07-24 Thread zamazan4ik at tut dot by
Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- For this code: float foo(float x, float y) { return x * y/y; } gcc(trunk,9,8,7,6,5) with '-O3 -ffast-math

[Bug c++/87849] Missed optimization: useless for-loop must be eliminated

2018-11-01 Thread zamazan4ik at tut dot by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87849 --- Comment #1 from Alexander Zaitsev --- Same for code without using STL algorithms and containers: int min(int a, int b) { return a < b ? a : b; } int max(int a, int b) { return a > b ? a : b; } int foo(int* v, int size) { int l

[Bug c++/87849] New: Missed optimization: useless for-loop must be eliminated

2018-11-01 Thread zamazan4ik at tut dot by
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc(trunk) with -O3 -std=c++17 for this code: #include #include int foo(std::vector v) { int l = v[0]; for(const auto& x

[Bug tree-optimization/83354] Missed optimization in math expression: pow(cbrt(x), y) == pow(x, y / 3)

2018-11-01 Thread zamazan4ik at tut dot by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83354 --- Comment #2 from Alexander Zaitsev --- Yes, you are right. My bad. Closing this issue.

[Bug tree-optimization/83350] Missed optimization in math expression: missing cube of the sum formula

2018-11-01 Thread zamazan4ik at tut dot by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83350 --- Comment #2 from Alexander Zaitsev --- Sure. Do you know about any activity in gcc in implementing or integrating built-in math engine for optimizing such expressions?

[Bug tree-optimization/83348] Missed optimization in math expression: can be used std::pow function

2018-11-01 Thread zamazan4ik at tut dot by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83348 --- Comment #2 from Alexander Zaitsev --- Thank you for the great comment! Should I close this issue?

[Bug tree-optimization/83354] Missed optimization in math expression: pow(cbrt(x), y) == pow(x, y / 3)

2018-11-01 Thread zamazan4ik at tut dot by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83354 Alexander Zaitsev changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|---

[Bug tree-optimization/83353] Missed optimization in math expression: sin(asin(a)) == a

2018-11-01 Thread zamazan4ik at tut dot by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83353 --- Comment #3 from Alexander Zaitsev --- FMPOV compiler should optimize as much as possible. If it's too time consuming, I prefer some additional compiler option like -f-do-some-math-time-consuming-optimization. And yes - developers canot

[Bug tree-optimization/83352] Missed optimization in math expression: sqrt(sqrt(a)) == pow(a, 1/4)

2018-11-01 Thread zamazan4ik at tut dot by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83352 --- Comment #2 from Alexander Zaitsev --- What about longer sqrt functions call? gcc(trunk) -O3 -ffast-math: double test(double a) { return sqrt(sqrt(sqrt(sqrt(sqrt(a); } test(double): andpd xmm0, XMMWORD PTR .LC0[rip]

[Bug c++/87429] New: Strange overload resolution with decltype in template function

2018-09-25 Thread zamazan4ik at tut dot by
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc(trunk) for this code: #include template int foo(int) { return 1; } template int foo(decltype(T{})) { return 2; } template int foo

[Bug c++/85747] suboptimal code without constexpr

2018-08-06 Thread zamazan4ik at tut dot by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85747 Alexander Zaitsev changed: What|Removed |Added CC||zamazan4ik at tut dot

[Bug tree-optimization/86707] New: Missed optimization: optimizing set of if statements

2018-07-27 Thread zamazan4ik at tut dot by
Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc(trunk) with -O3 -std=c++17 for this code: unsigned int foo(unsigned int x) { if(x % 2 == 0) { return x * 2; } if(x % 4 == 0

[Bug libstdc++/84688] New: Use pdqsort instead of introsort for std::sort

2018-03-03 Thread zamazan4ik at tut dot by
: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- I suggest use pdqsort for std::sort, because pdqsort is really faster. Here you can find benchmarks: https://github.com/orlp/pdqsort

[Bug c++/84560] Internal error in std::function with std::memset

2018-02-25 Thread zamazan4ik at tut dot by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84560 --- Comment #1 from Alexander Zaitsev --- On GCC 7.3.1 for this code I have: internal compiler error: в expand_expr_real_1, в expr.c:9908 memset(d[n - 1], 0, sizeof(int)); ^ Please submit a full bug report, with

[Bug c++/84560] New: Internal error in std::function with std::memset

2018-02-25 Thread zamazan4ik at tut dot by
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc(trunk) with '-O3 -march=native --std=c++11 -Wall' for this code: #include #include using namespace std; int main() { int n = 1; int m = 1; int d[n][m

[Bug tree-optimization/84512] New: Missed optimization: should be precalculated in compile-time

2018-02-22 Thread zamazan4ik at tut dot by
Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc(trunk) with '-O3' option for this code: int foo() { int a[10]; for(int i = 0; i < 10; ++i) {

[Bug c++/82478] Rejects valid access to private member type that should be allowed by friend

2018-02-07 Thread zamazan4ik at tut dot by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82478 Alexander Zaitsev changed: What|Removed |Added CC||zamazan4ik at tut dot

[Bug tree-optimization/83715] New: Missed optimization in math expression: optimize double comparing

2018-01-06 Thread zamazan4ik at tut dot by
Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc trunk with '-O3 -ffast-math -std=c++17' for this code: double test(double x, double y) { if(x != y

[Bug tree-optimization/83541] New: Missed optimization with int overflow

2017-12-21 Thread zamazan4ik at tut dot by
-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc(trunk) with '-O3 -std=c++17 -ffast-math' for this: #include int test(int x) { if(x == std::numeric_limits::max()) { return x+1; } return

[Bug tree-optimization/83518] New: Missing optimization: useless instructions should be dropped

2017-12-20 Thread zamazan4ik at tut dot by
Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc (trunk) with '-O3 -std=c++17' for this code: unsigned test() { int arr[] = {5,4,3,2,1}; int sum = 0; for(int

[Bug tree-optimization/83517] New: Missed optimization in math expression: (x+x)/x == 2

2017-12-20 Thread zamazan4ik at tut dot by
Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc (trunk) with '-O3 -std=c++17 -ffast-math -funsafe-math-optimizations' for this code: int test(int x) { return (x+x)/x; } generates: test(int

[Bug c++/83384] New: Optimize heap allocation as stack allocation

2017-12-11 Thread zamazan4ik at tut dot by
++ Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc(trunk) with '--std=c++17 -O3' for this code: int test(int a) { int res = 0; int* i = new int; for(*i = 0; *i < a; *i = *i + 1) { res +=

[Bug tree-optimization/83354] New: Missed optimization in math expression: pow(cbrt(x), y) == pow(x, y / 3)

2017-12-10 Thread zamazan4ik at tut dot by
Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc(trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags for this code: #include double test(double x

[Bug tree-optimization/83353] Missed optimization in math expression: sin(asin(a)) == a

2017-12-10 Thread zamazan4ik at tut dot by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83353 --- Comment #1 from Alexander Zaitsev --- The same issue about cos(acos(x)).

[Bug tree-optimization/83353] New: Missed optimization in math expression: sin(asin(a)) == a

2017-12-10 Thread zamazan4ik at tut dot by
Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc(trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags for this code: #include double test(double a) { return sin

[Bug tree-optimization/83352] New: Missed optimization in math expression: sqrt(sqrt(a)) == pow(a, 1/4)

2017-12-10 Thread zamazan4ik at tut dot by
Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc(trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags for this code: #include double test(double

[Bug tree-optimization/83351] New: Missed optimization in math expression: sin^2(a) + cos^2(a) == 1

2017-12-10 Thread zamazan4ik at tut dot by
Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc(trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags for this code: #include double test(double

[Bug tree-optimization/83350] New: Missed optimization in math expression: missing cube of the sum formula

2017-12-10 Thread zamazan4ik at tut dot by
Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc(trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags for this code: double test(double a, double b

[Bug tree-optimization/83349] New: Missed optimization in math expression: aggressive optimization with std::pow

2017-12-10 Thread zamazan4ik at tut dot by
: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc(trunk) with '--std=c++17 -O3 -march=native -ffast-math' flags for this code: #include double test(double

[Bug tree-optimization/83348] New: Missed optimization in math expression: can be used std::pow function

2017-12-10 Thread zamazan4ik at tut dot by
Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zamazan4ik at tut dot by Target Milestone: --- gcc(trunk) with optimization flags '--std=c++17 -O3 -march=native -ffast-math' for this code: double f(double