[Bug ipa/97119] Top level option to disable creation of IPA symbols such as .localalias is desired

2024-02-02 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97119 --- Comment #7 from Jan Hubicka --- Local aliases are created by ipa-visibility pass. Most common case is that function is declared inline but ELF superposition rules say that the symbol can be overwritten by a different library. Since GCC know

[Bug ipa/113359] [13 Regression] LTO miscompilation of ceph on aarch64

2024-02-06 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113359 --- Comment #11 from Jan Hubicka --- If there are two ODR types with same ODR name one with integer and other with pointer types third field, then indeed we should get ODR warning and give up on handling them as ODR types for type merging. So d

[Bug tree-optimization/113787] [12/13/14 Regression] Wrong code at -O with ipa-modref on aarch64

2024-02-06 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113787 --- Comment #8 from Jan Hubicka --- I will take a look. Mod-ref only reuses the code detecting errneous paths in ssa-split-paths, so that code will get confused, too. It makes sense for ivopts to compute difference of two memory allocations, bu

[Bug lto/114501] [12/13/14/15 Regression] ICE during lto streaming

2024-07-22 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114501 Jan Hubicka changed: What|Removed |Added Summary|[12/13/14/15 Regression]|[12/13/14/15 Regression]

[Bug ipa/115033] [12/13/14/15 Regression] Incorrect optimization of by-reference closure fields by fre1 pass since r12-5113-gd70ef65692fced

2024-07-22 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115033 --- Comment #18 from Jan Hubicka --- modref_eaf_analysis::analyze_ssa_name misinterprets EAF flags. If dereferenced parameter is passed (to map_iterator in the testcase) it can be returned indirectly which in turn makes it to escape into the ne

[Bug tree-optimization/114207] [12/13/14/15 Regression] modref gets confused by vecotorized code ` -O3 -fno-tree-forwprop` since r12-5439

2024-07-22 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114207 --- Comment #5 from Jan Hubicka --- The offset gets lost in ipa-prop.cc diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc index 7d7cb3835d2..99ebd6229ec 100644 --- a/gcc/ipa-prop.cc +++ b/gcc/ipa-prop.cc @@ -1370,9 +1370,9 @@ unadjusted_ptr_and_un

[Bug ipa/111613] [12/13/14/15 Regression] Bit field stores can be incorrectly optimized away when -fstore-merging is in effect since r12-5383-g22c242342e38eb

2024-07-22 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111613 --- Comment #7 from Jan Hubicka --- I suppose there is not much to do about past noread flags. I do not see how optimization can invalidate other properties, so I am testing the following: diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc inde

[Bug middle-end/115277] [13 regression] ICF needs to match loop bound estimates

2024-07-22 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115277 Jan Hubicka changed: What|Removed |Added Summary|[13/14/15 regression] ICF |[13 regression] ICF needs

[Bug ipa/113291] [14/15 Regression] compilation never (?) finishes with recursive always_inline functions at -O and above since r14-2172

2024-07-22 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113291 Jan Hubicka changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug ipa/115033] [12/13 Regression] Incorrect optimization of by-reference closure fields by fre1 pass since r12-5113-gd70ef65692fced

2024-07-22 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115033 Jan Hubicka changed: What|Removed |Added Summary|[12/13/14/15 Regression]|[12/13 Regression] |Inc

[Bug ipa/114207] [12/13 Regression] modref gets confused by vectorized code `-O3 -fno-tree-forwprop` since r12-5439

2024-07-22 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114207 Jan Hubicka changed: What|Removed |Added Summary|[12/13/14/15 Regression]|[12/13 Regression] modref

[Bug ipa/111613] [12/13 Regression] Bit field stores can be incorrectly optimized away when -fstore-merging is in effect since r12-5383-g22c242342e38eb

2024-07-22 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111613 Jan Hubicka changed: What|Removed |Added Summary|[12/13/14/15 Regression]|[12/13 Regression] Bit

[Bug ipa/113907] [12/13 regression] ICU miscompiled on x86 since r14-5109-ga291237b628f41

2024-07-22 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113907 Jan Hubicka changed: What|Removed |Added Summary|[12/13/14/15 regression]|[12/13 regression] ICU

[Bug tree-optimization/109985] [12/13/14 Regression] __builtin_prefetch ignored by GCC 12/13

2024-07-22 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109985 Jan Hubicka changed: What|Removed |Added Summary|[12/13/14/15 Regression]|[12/13/14 Regression] |

[Bug ipa/106783] [12/13/14/15 Regression] ICE in ipa-modref.cc:analyze_function since r12-5247-ga34edf9a3e907de2

2024-07-23 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106783 --- Comment #6 from Jan Hubicka --- The problem is that n/=0 is undefined behavior (so we can optimize out call to function doing divide by zero), while __builtin_trap is observable and we do not optimize out code paths that may trip to it. so

[Bug ipa/116055] [14/15 Regression] ICE from gcc.c-torture/unsorted/dump-noaddr.c after "Fix modref's iteraction with store merging"

2024-07-25 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116055 --- Comment #4 from Jan Hubicka --- This does not reproduce for me (with trunk nor gcc14 build with --target=powerpc64le-linux-gnu) However the problem is almost surely sanity check in dumping code that flags does not get worse (which they can

[Bug ipa/116055] [14/15 Regression] ICE from gcc.c-torture/unsorted/dump-noaddr.c after "Fix modref's iteraction with store merging"

2024-07-29 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116055 Jan Hubicka changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug ipa/109914] --suggest-attribute=pure misdiagnoses static functions

2024-07-29 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109914 --- Comment #7 from Jan Hubicka --- The idea is to help developers to annotate i.e. binary tree search function, which he clearly knows is always to be finite, but compiler can not prove it. Intentional infinite loops with no side effects writte

[Bug lto/116907] [14/15 regression] ICE when building kakoune-2024.05.18 with LTO

2024-10-06 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116907 --- Comment #26 from Jan Hubicka --- GGC should not release blocks that are still in use. They are linked by function's block tree and only if dead they are removed by tree-ssa-live.cc So the question is why that expr has dangliing pointer to d

[Bug lto/116907] [14/15 regression] ICE when building kakoune-2024.05.18 with LTO

2024-10-06 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116907 --- Comment #27 from Jan Hubicka --- Hmm, I can not seem to reproduce it. Basically we need to work out why that expression is streamed. If it is part of function body or part of summary. For summary it may be missing call to unshare_expr_witho

[Bug c++/117370] New: std::nothrow variants of operator new are not optimized away when block is unused

2024-10-30 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117370 Bug ID: 117370 Summary: std::nothrow variants of operator new are not optimized away when block is unused Product: gcc Version: 15.0 Status: UNCONFIRMED Severi

[Bug c++/110137] implement clang -fassume-sane-operator-new

2024-10-31 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110137 --- Comment #28 from Jan Hubicka --- We could make -fassume-sane-operator-new optimization attribute, but then we would need to prevent inlining functions with insane operators to functions with sane operators, or drop the sanity on caller.

[Bug c++/110137] implement clang -fassume-sane-operator-new

2024-10-31 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110137 --- Comment #27 from Jan Hubicka --- This is somewhat weird testcase which makes two allocations which compiler can track as non-escaping and tests its ability to disambiguate them: int test3(int *data) { int *val = new int; *va

[Bug c++/110137] implement clang -fassume-sane-operator-new

2024-10-31 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110137 --- Comment #29 from Jan Hubicka --- For completeness note that we can also stick info into FUNCTION_DECLs (i.e. by an attribute) to avoid flags pollution. Then it could be TU sensitive since lto-symtab knows that in certain cases it should not

[Bug middle-end/116868] GCC trunk doesn't eliminate a superfluous new/delete pair

2024-11-12 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116868 Jan Hubicka changed: What|Removed |Added CC||hubicka at gcc dot gnu.org --- Comment #4

[Bug middle-end/116868] GCC trunk doesn't eliminate a superfluous new/delete pair

2024-11-12 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116868 Jan Hubicka changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug tree-optimization/96945] unused std::vector is not always optimized away

2024-11-12 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96945 Jan Hubicka changed: What|Removed |Added CC||hubicka at gcc dot gnu.org Sta

[Bug libstdc++/109442] Dead local copy of std::vector not removed from function

2024-11-12 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109442 --- Comment #23 from Jan Hubicka --- with Jakub's builtion_operator_new patch and https://gcc.gnu.org/pipermail/gcc-patches/2024-November/667834.html on the original testcase we now optimize away allocation and produce int vat1 (struct vector &

[Bug tree-optimization/58483] missing optimization opportunity for const std::vector compared to std::array

2024-11-12 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58483 Jan Hubicka changed: What|Removed |Added CC||hubicka at gcc dot gnu.org --- Comment #19

[Bug other/85716] No easy way for end-user to tell what GCC is doing when compilation is slow

2024-09-17 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85716 Jan Hubicka changed: What|Removed |Added CC||hubicka at gcc dot gnu.org --- Comment #16

[Bug target/116582] gather is a win in some cases on zen CPUs

2024-09-19 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116582 --- Comment #6 from Jan Hubicka --- Here is a variant of benchmark that needs masking #include #define M 1024*1024 T a[M], b[M]; int indices[M]; char c[M]; __attribute__ ((noipa)) void test () { for (int i = 0; i < 1024* 16; i++) if (c[i

[Bug ipa/117440] [12/13/14/15 regression] ICE: in merge, at ipa-modref.cc:2138 at -Os

2024-11-06 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117440 --- Comment #3 from Jan Hubicka --- When processing covariant return thunk to g::f() const which is expanded to gimple we get stuck on: # .MEM_6 = VDEF <.MEM_4(D)> g::*.LTHUNK0 (this_5(D)); It fails on sanity check of EAF flags: /* Check tha

[Bug ipa/117440] [12/13/14/15 regression] ICE: in merge, at ipa-modref.cc:2138 at -Os

2024-11-06 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117440 --- Comment #4 from Jan Hubicka --- OK, so the problem is that we analyze function body of g::f which is declared with pure attribute: modref analyzing 'virtual g* g::f() const/1' (ipa=0) (pure) Analyzing flags of ssa name: this_4(D) Analyzin

[Bug ipa/117432] [12/13/14/15 Regression] IPA ICF disregards types of variadic arguments since r10-4643-ga37f58f506e436

2024-11-06 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117432 --- Comment #7 from Jan Hubicka --- Hash needs to be stable for LTO streaming which affects types. But at least we ought to compare types when we are comparing bodies in func_checker::compare_gimple_call. I guess for non-varadic calls this hap

[Bug tree-optimization/117764] [15 Regression] cddce should handle __builtin_unreachable guards

2024-11-24 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117764 Jan Hubicka changed: What|Removed |Added Summary|cddce should handle |[15 Regression] cddce |

[Bug ipa/86590] Codegen is poor when passing std::string by value with _GLIBCXX_EXTERN_TEMPLATE undefined

2024-11-27 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86590 Jan Hubicka changed: What|Removed |Added CC||mjambor at suse dot cz --- Comment #36 fro

[Bug tree-optimization/117639] Modified loop-split-1.C doesn't recognise non-escaping std::vector

2024-11-18 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117639 Jan Hubicka changed: What|Removed |Added CC||jwakely at redhat dot com,

[Bug tree-optimization/117710] New: repeated calls to std::function are not inlined

2024-11-20 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117710 Bug ID: 117710 Summary: repeated calls to std::function are not inlined Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Componen

[Bug ipa/117672] Remove unused virtual methods

2024-11-19 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117672 --- Comment #4 from Jan Hubicka --- There is constructor of the static variable (_GLOBAL__sub_I_main) which we do not optimize out since we think it makes useful memory writes since at that stage we do not know that static var is effectively wri

[Bug libstdc++/109442] Dead local copy of std::vector not removed from function

2024-11-16 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109442 --- Comment #32 from Jan Hubicka --- thanks. I think codegen should be fine, so I will commit the patch so we get it tested by LNT. We may get bit better here. Applying the reverted _M_invariant patch (r14-1452-gfb409a15d9babc) gets me 133 bad_

[Bug libstdc++/109442] Dead local copy of std::vector not removed from function

2024-11-16 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109442 --- Comment #30 from Jan Hubicka --- Created attachment 59610 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59610&action=edit patch for non-negative checks in std::vector::size and std::vector::capacity This patch adds non-negativity che

[Bug libstdc++/109442] Dead local copy of std::vector not removed from function

2024-11-15 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109442 --- Comment #26 from Jan Hubicka --- After some more checking we need help from libstdc++ here. Problem is that size does the pointer subtraction which is always positive, but we do not know it, and then converts it to size_type. The following

[Bug tree-optimization/116518] GCC does not optimize-out useless operations. Clang does.

2024-11-15 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116518 --- Comment #7 from Jan Hubicka --- I wonder if DSE can use gimple_call_from_new_or_delete even without -fassume-sane-operator-new. In normal use of operator delete we know that the object in question was destroyed and thus memory is undefined.

[Bug tree-optimization/58483] missing optimization opportunity for const std::vector compared to std::array

2024-11-18 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58483 --- Comment #23 from Jan Hubicka --- one in comment #0 optimizes with me provided that destructors are inline jh@shroud:/tmp> cat tt.C #include #include #include //static int calc(const std::array p_ints, const int& p_init) static int calc(c

[Bug tree-optimization/117793] New: missed copy propagation across memcpy

2024-11-26 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117793 Bug ID: 117793 Summary: missed copy propagation across memcpy Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-op

[Bug libstdc++/80331] unused const std::string not optimized away

2024-11-26 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 --- Comment #12 from Jan Hubicka --- I think with my patch to basic_string we should have at least arrived to something comparable with clang. With -O2 it is optimized away, with -O2 -D_GLIBCXX_USE_CXX11_ABI=0 I get: int sain () { struct alloc

[Bug tree-optimization/79349] unused std::string is not optimized away in presense of a call

2024-11-27 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79349 Jan Hubicka changed: What|Removed |Added CC||hubicka at gcc dot gnu.org --- Comment #6

[Bug tree-optimization/117764] New: cddce should handle __builtin_unreachable guards

2024-11-24 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117764 Bug ID: 117764 Summary: cddce should handle __builtin_unreachable guards Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Compone

[Bug ipa/113197] [12/13/14 Regression] ICE in in handle_call_arg, at tree-ssa-structalias.cc:4119 since r12-5177-g494bdadf28d0fb

2024-11-26 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113197 Jan Hubicka changed: What|Removed |Added Assignee|rguenth at gcc dot gnu.org |hubicka at gcc dot gnu.org --- Co

[Bug tree-optimization/117489] [12/13/14/15 Regression] ICE in handle_call_arg, at tree-ssa-structalias.cc:4226 at -O1 and above with "-fno-ipa-pure-const -fsanitize=undefined" and pure and no sanitiz

2024-11-26 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117489 --- Comment #7 from Jan Hubicka --- The problem here (and with the assert Richi nuked in PR 113197) is that the flags really are: no_direct_clobber no_indirect_clobber no_direct_escape no_indirect_escape not_returned_indirectly no_direct_read n

[Bug ipa/117892] [15 Regression] ICE on valid code at -O1 and above on x86_64-linux-gnu: in single_succ_edge, at basic-block.h:332 since r15-5336-gcee7d080d5c2a5

2024-12-03 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117892 --- Comment #2 from Jan Hubicka --- This is mine. The loop first checks that basic block is empty (consits only of debug statements, predicts, clobbers and nops) and then it asserts that there is only one edge out, which ought to be the case. I

[Bug tree-optimization/117875] [15 Regression] 28% regression for 456.hmmer on Zen4 with -Ofast -march=native

2024-12-03 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117875 Jan Hubicka changed: What|Removed |Added Ever confirmed|0 |1 Status|UNCONFIRMED

[Bug tree-optimization/117924] New: unused std::vector are not optimized out fully at gimple level

2024-12-05 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117924 Bug ID: 117924 Summary: unused std::vector are not optimized out fully at gimple level Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal

[Bug tree-optimization/117924] unused std::vector are not optimized out fully at gimple level

2024-12-05 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117924 --- Comment #1 from Jan Hubicka --- looking at dse3 dump we get: [local count: 1073741824]: MEM[(struct _Bvector_impl_data *)&data] ={v} {CLOBBER(bob)}; MEM[(struct __as_base &)&data] ={v} {CLOBBER(bob)}; _13 = MEM[(const struct vecto

[Bug c++/103827] function which takes an argument via (hidden) reference should assume the argument does not escape or is only read from

2024-12-08 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103827 Jan Hubicka changed: What|Removed |Added CC||hubicka at gcc dot gnu.org,

[Bug libstdc++/87502] Poor code generation for std::string("c-style string")

2024-12-08 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87502 Jan Hubicka changed: What|Removed |Added CC||hubicka at gcc dot gnu.org Ever confir

[Bug tree-optimization/117957] New: vectorization pesimises std::vector push/pop test

2024-12-08 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117957 Bug ID: 117957 Summary: vectorization pesimises std::vector push/pop test Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Compon

[Bug ipa/118318] ICE when building firefox-134.0 with PGO and LTO

2025-01-07 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118318 --- Comment #6 from Jan Hubicka --- Some profile inconsistencies are expected unless you use atomic counters since Firefox uses threads. Do you know why compatible_p returns false? It looks like mixing IPA and function local profiles together..

[Bug tree-optimization/117639] Modified loop-split-1.C doesn't recognise non-escaping std::vector

2024-12-27 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117639 --- Comment #3 from Jan Hubicka --- With -O3 -std=c++20 https://godbolt.org/z/3WKnn8rax we inline but still get stuck on loop calling log and modifying errno. Without -std=c++20 we reach --param max-inline-insns-auto. We need --param max-inlin

[Bug c++/86276] Poor codegen when returning a std::vector

2024-12-27 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86276 --- Comment #2 from Jan Hubicka --- With -O3 we now do quite well. _Z4goodv: .LFB1248: .cfi_startproc ret .cfi_endproc .LFE1248: .size _Z4goodv, .-_Z4goodv .p2align 4 .globl _Z3badv .typ

[Bug tree-optimization/117638] No loop splitting and bounds check not optimized out with -D_GLIBCXX_ASSERTIONS

2024-12-27 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117638 --- Comment #4 from Jan Hubicka --- Both with assertions or without we offline _M_default_append which would be better inlined. It is because main is known to be called once. One difference is that non-assertion clobbers the vectors prior const

[Bug tree-optimization/26388] Variable sized storage allocation should be promoted to stack allocation

2024-12-27 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26388 Jan Hubicka changed: What|Removed |Added CC||hubicka at gcc dot gnu.org --- Comment #20

[Bug target/80813] [12/13/14/15 Regression] x86: std::vector::operator[] could be somewhat faster using BT instead of SHL

2024-12-27 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80813 --- Comment #6 from Jan Hubicka --- Patch to optimize operator[] to be again branchless posted https://gcc.gnu.org/pipermail/gcc-patches/2024-December/672286.html Main problem with auto-generating bt is that it needs change of conditional from C

[Bug tree-optimization/80641] missed optimization with with std::vector resize in loop

2024-12-27 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80641 --- Comment #18 from Jan Hubicka --- With -O3 we now get: int main () { [local count: 114863531]: return 0; } -O2 offlines destructors which prevents us from optimizing away new() int main () { void * D.27676; int * c$_M_finish; int

[Bug tree-optimization/90345] too pessimistic check whether pointer may alias a local variable

2024-12-28 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90345 Jan Hubicka changed: What|Removed |Added Last reconfirmed|2024-04-10 00:00:00 |2024-12-28 CC|

[Bug ipa/117984] New: missed IPA constant propagation

2024-12-10 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117984 Bug ID: 117984 Summary: missed IPA constant propagation Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa As

[Bug c++/103827] function which takes an argument via (hidden) reference should assume the argument does not escape or is only read from

2024-12-09 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103827 --- Comment #9 from Jan Hubicka --- Jason, did you intend to close this as invalid? I think we agreed on the original testcase being valid - we can assume that calls to extern void foo (const std::string ); can assume the string argument being

[Bug ipa/86590] Codegen is poor when passing std::string by value with _GLIBCXX_EXTERN_TEMPLATE undefined

2024-12-10 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86590 --- Comment #40 from Jan Hubicka --- As discussed with Jason, problem with _M_create not seen by middle-end is actually due to C++ standard. Explicit instantiations prevents implicit ones for non-inline functions, see discussion in PR39242. With

[Bug libstdc++/80331] unused const std::string not optimized away

2024-12-10 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 --- Comment #13 from Jan Hubicka --- As discussed with Jason, problem with _M_create not seen by middle-end is actually due to C++ standard. Explicit instantiations prevents implicit ones for non-inline functions, see discussion in PR39242. With

[Bug tree-optimization/117875] [15 Regression] 28% regression for 456.hmmer on Zen4 with -Ofast -march=native

2024-12-10 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117875 --- Comment #12 from Jan Hubicka --- I tried final_value_replacement_loop on simplified testcase where second loop has known number of iterations: void foo(int *a, int *b, int n) { if (n > 3 && n < 10) for (int i = 0; i

[Bug c++/103827] function which takes an argument via (hidden) reference should assume the argument does not escape or is only read from

2024-12-10 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103827 --- Comment #11 from Jan Hubicka --- I see, I misread Jonathan's answer. If const is relevant only on definition, what about this one: #include struct foo { int a; void bar() const; ~foo() { if (a != 42) printf ("optimize me

[Bug libstdc++/80331] unused const std::string not optimized away

2024-12-10 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 --- Comment #14 from Jan Hubicka --- Declaring _S_create and _M_create inline indeed helps a little: diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index 17b973c8b45..d73a61abe5b 100644 --- a/lib

[Bug libstdc++/60621] std::vector::emplace_back generates massively more code than push_back

2024-12-15 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60621 Jan Hubicka changed: What|Removed |Added Ever confirmed|0 |1 Status|UNCONFIRMED

[Bug tree-optimization/86701] Optimize strlen called on std::string c_str()

2024-12-15 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86701 Jan Hubicka changed: What|Removed |Added CC||hubicka at gcc dot gnu.org --- Comment #5

[Bug c++/97094] Compiling big std::unordered_map became slower

2024-12-15 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97094 Jan Hubicka changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed|

[Bug c++/103827] function which takes an argument via (hidden) reference should assume the argument does not escape or is only read from

2024-12-14 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103827 Jan Hubicka changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever confirmed|0

[Bug libstdc++/80331] unused const std::string not optimized away

2024-12-14 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 --- Comment #15 from Jan Hubicka --- Original testcase is solved by https://gcc.gnu.org/pipermail/gcc-patches/2024-December/671599.html We still won't optimize longer strings because _M_create is not inline.

[Bug libstdc++/87502] Poor code generation for std::string("c-style string")

2024-12-14 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87502 --- Comment #16 from Jan Hubicka --- https://gcc.gnu.org/pipermail/gcc-patches/2024-December/671599.html optimizes the string constructors. Having strlen pass catching more cases would be nice, too.

[Bug libstdc++/80331] unused const std::string not optimized away

2024-12-14 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80331 Jan Hubicka changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug tree-optimization/117924] unused std::vector are not optimized out fully at gimple level

2024-12-14 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117924 Jan Hubicka changed: What|Removed |Added Last reconfirmed||2024-12-14 Ever confirmed|0

[Bug libstdc++/109442] Dead local copy of std::vector not removed from function

2024-12-13 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109442 --- Comment #35 from Jan Hubicka --- On #include bool test1(const std::vector& in) { return in == std::vector{42}; } we produce: bool test1 (const struct vector & in) { bool _12; int * _13; int * _14; long int _24; unsigned in

[Bug c++/94960] extern template prevents inlining of standard library objects

2024-12-13 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94960 --- Comment #10 from Jan Hubicka --- Note that passing function body to middle-end does not only enable inlining, but other optimizations too. Often ipa-modref is able to summarize side effects of the function and enables more optimization, since

[Bug ipa/93921] -Os generates much bigger code than -O{1,2,3,fast} for std::string::size

2024-12-13 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93921 Jan Hubicka changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug c++/118130] New: std::vector code quality issues

2024-12-19 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118130 Bug ID: 118130 Summary: std::vector code quality issues Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ As

[Bug libstdc++/90436] Redundant size checking in vector

2024-12-19 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90436 Jan Hubicka changed: What|Removed |Added Resolution|--- |FIXED Status|UNCONFIRMED

[Bug tree-optimization/109440] Missed optimization of vector::at when a function is called inside the loop

2024-12-19 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109440 --- Comment #3 from Jan Hubicka --- I believe that since v is constructed and passed by invisible refernece in the caller, we would need to know constructors of std::vector and prove that they do not make &v to escape to global memory, so foo ca

[Bug libstdc++/110287] _M_check_len is expensive

2024-12-19 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110287 Jan Hubicka changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug middle-end/109849] suboptimal code for vector walking loop

2024-12-19 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109849 Bug 109849 depends on bug 110287, which changed state. Bug 110287 Summary: _M_check_len is expensive https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110287 What|Removed |Added -

[Bug ipa/110378] IPA-SRA for destructors

2024-12-19 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110378 --- Comment #10 from Jan Hubicka --- Martin, I think this is fixed?

[Bug libstdc++/114821] _M_realloc_append should use memcpy instead of loop to copy data when possible

2024-12-19 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114821 --- Comment #14 from Jan Hubicka --- Jonathan, is there some problem with your patch?

[Bug target/80813] [12/13/14/15 Regression] x86: std::vector::operator[] could be somewhat faster using BT instead of SHL

2024-12-20 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80813 --- Comment #5 from Jan Hubicka --- Combine constructs: (set (reg:CCZ 17 flags) (compare:CCZ (zero_extract:DI (mem:DI (plus:DI (mult:DI (reg:DI 111 [ _8 ]) (const_int 8 [0x8])) (reg/f:DI 112 [ v_2(

[Bug target/80813] [12/13/14/15 Regression] x86: std::vector::operator[] could be somewhat faster using BT instead of SHL

2024-12-20 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80813 --- Comment #3 from Jan Hubicka --- OK, so the horrid codegen is because bvector's [] operator is imlemented using iterator: return begin()[__n]; iterator's [] operator is implemented using: _GLIBCXX20_CONSTEXPR void _M_incr(ptrdif

[Bug target/80813] [12/13/14/15 Regression] x86: std::vector::operator[] could be somewhat faster using BT instead of SHL

2024-12-20 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80813 --- Comment #4 from Jan Hubicka --- Bit_reference constructor takes mask and not bit position. _GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR reference operator[](size_type __n) { __glibcxx_requires_subscript(__n);

[Bug target/80813] [12/13/14/15 Regression] x86: std::vector::operator[] could be somewhat faster using BT instead of SHL

2024-12-20 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80813 Jan Hubicka changed: What|Removed |Added Status|UNCONFIRMED |NEW Summary|x86:

[Bug tree-optimization/118527] When a loop is unlooped due to sccvn, its profile is not updated

2025-01-17 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118527 --- Comment #3 from Jan Hubicka --- The reason why I did not implement profile fixups to cfgcleanup is that you can not really fix the profile without knowing why it became inconsistent. Consider situation where we have function foo (int a) {

[Bug target/119368] immintrin code running slower with gcc than clang

2025-03-24 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119368 --- Comment #5 from Jan Hubicka --- Thinking of it more, I think enabling memory alternatives in (define_insn "sse4_1_v4hiv4si2" [(set (match_operand:V4SI 0 "register_operand" "=Yr,*x,v") (any_extend:V4SI (vec_select:V4HI (m

[Bug ipa/119312] Constant array not allocated in read-only segment

2025-03-18 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119312 --- Comment #12 from Jan Hubicka --- Indeed at IPA level we track if address of a symbol is taken, but we do not keep any extra info about how it may be used. It would be useful to track 1) if address is used only to read (to figure out readon

[Bug ipa/119312] Constant array not allocated in read-only segment

2025-03-18 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119312 --- Comment #13 from Jan Hubicka --- And forgot to write. In case of strcmp I think we can use fnspec info we already have at the time constructing callgraph to represent it as a read rather than taking address. This would make things go bit sm

[Bug target/119368] New: immintrin code running slower with gcc than clang

2025-03-19 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119368 Bug ID: 119368 Summary: immintrin code running slower with gcc than clang Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component

[Bug target/119298] [15 Regression] 538.imagick_r is faster when compiled with GCC 14.2 and -Ofast -flto -march=native than with master on Zen5 since r15-3441-g4292297a0f938f

2025-04-09 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119298 --- Comment #14 from Jan Hubicka --- > > I am OK with using addss cost of 3 for trunk&release branches and make this > > more precise next stage1. > > That's what we use now? But I still don't understand why exactly > 538.imagick_r regresses

<    3   4   5   6   7   8   9   >