[Bug middle-end/109967] [10/11/12/13/14 Regression] Wrong code at -O2 on x86_64-linux-gnu

2023-06-05 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109967 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug tree-optimization/110035] Missed optimization for dependent assignment statements

2023-06-06 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110035 --- Comment #15 from Alexander Monakov --- malloc and friends modify 'errno' on failure, so in they would have to be special-cased for alias analysis.

[Bug c/110169] wrong code with '-Ofast'

2023-06-08 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110169 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug rtl-optimization/110202] _mm512_ternarylogic_epi64 generates unnecessary operations

2023-06-12 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110202 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug rtl-optimization/110237] gcc.dg/torture/pr58955-2.c is miscompiled by RTL scheduling after reload

2023-06-14 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110237 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug c/110249] __builtin_unreachable helps optimisation at -O1 but not at -O2

2023-06-14 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110249 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug web/110250] Broken url to README in st/cli-be project

2023-06-14 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110250 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug target/110260] Multiple applications misbehave when compiled with -march=znver4

2023-06-15 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110260 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug target/110260] Multiple applications misbehave when compiled with -march=znver4

2023-06-15 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110260 --- Comment #6 from Alexander Monakov --- (In reply to Jimi Huotari from comment #0) > (By the by, is ADCX a typo of ADX? I see -madx as an option but only one > use of it otherwise, and no -adcx as an option and lots of mentions of it... > but

[Bug target/110260] Multiple applications misbehave at runtime when compiled with -march=znver4

2023-06-15 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110260 --- Comment #10 from Alexander Monakov --- Right, those are different issues. Any chance of a standalone testcase extracted from Wine? If you already see a function where stack realignment is missing, just give us preprocessed containing source,

[Bug target/110273] i686-w64-mingw32 with -march=znver4 generates AVX instructions without stack alignment

2023-06-16 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273 --- Comment #3 from Alexander Monakov --- Seems to work fine with explicit '-mincoming-stack-boundary=2' on the command line, even though it should make no difference for the 32-bit MinGW target.

[Bug target/110273] i686-w64-mingw32 with -march=znver4 generates AVX instructions without stack alignment

2023-06-16 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273 --- Comment #4 from Alexander Monakov --- Further reduced: void f() { int c[4] = { 0, 0, 0, 0 }; int cc[8] = { 0 }; asm("" :: "m"(c), "m"(cc)); } Also reproducible with -march=skylake-avx512 or even plain -mavx512f, retitling.

[Bug target/110273] [12/13/14 Regression] i686-w64-mingw32 with -mavx512f generates AVX instructions without stack alignment

2023-06-16 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273 --- Comment #6 from Alexander Monakov --- Huh? Just compile the supplied testcases without avx512, you'll see proper stack realignment.

[Bug rtl-optimization/110307] ICE in move_insn, at haifa-sched.cc:5473 on alpha with -fPIC -fpeephole2 -fschedule-insns2

2023-06-19 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110307 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug rtl-optimization/110307] ICE in move_insn, at haifa-sched.cc:5473 when building Ruby on alpha with -fPIC -O2 (or -fpeephole2 -fschedule-insns2)

2023-06-19 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110307 --- Comment #3 from Alexander Monakov --- Do you have older versions of GCC to check on this testcase?

[Bug rtl-optimization/110307] ICE in move_insn, at haifa-sched.cc:5473 when building Ruby on alpha with -fPIC -O2 (or -fpeephole2 -fschedule-insns2)

2023-06-20 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110307 --- Comment #5 from Alexander Monakov --- It's not necessary yet for this particular bug, but might be helpful for future bugs (if disk space is not an issue).

[Bug rtl-optimization/110307] ICE in move_insn, at haifa-sched.cc:5473 when building Ruby on alpha with -fPIC -O2 (or -fpeephole2 -fschedule-insns2)

2023-06-20 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110307 --- Comment #6 from Alexander Monakov --- Cross-compiler needs HAVE_AS_EXPLICIT_RELOCS=1. With checking enabled, we get: t.c:8:1: error: flow control insn inside a basic block (call_insn 97 96 98 4 (parallel [ (set (reg:DI 0 $0)

[Bug rtl-optimization/110307] ICE in move_insn, at haifa-sched.cc:5473 when building Ruby on alpha with -fPIC -O2 (or -fpeephole2 -fschedule-insns2)

2023-06-21 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110307 --- Comment #8 from Alexander Monakov --- REG_EH_REGION is handled further down that function, but copy_reg_eh_region_note_backward does not copy the note. Perhaps it needs diff --git a/gcc/except.cc b/gcc/except.cc index e728aa43b6..cfe140c4d0

[Bug rtl-optimization/110307] ICE in move_insn, at haifa-sched.cc:5473 when building Ruby on alpha with -fPIC -O2 (or -fpeephole2 -fschedule-insns2)

2023-06-22 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110307 --- Comment #10 from Alexander Monakov --- I think the first patch may result in duplicated notes, so I wouldn't recommend picking it.

[Bug tree-optimization/110369] wrong code on x86_64-linux-gnu

2023-06-22 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110369 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug rtl-optimization/110307] ICE in move_insn, at haifa-sched.cc:5473 when building Ruby on alpha with -fPIC -O2 (or -fpeephole2 -fschedule-insns2)

2023-06-25 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110307 --- Comment #13 from Alexander Monakov --- Note to self: check how control_flow_insn_p relates.

[Bug rtl-optimization/110237] gcc.dg/torture/pr58955-2.c is miscompiled by RTL scheduling after reload

2023-06-26 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110237 --- Comment #11 from Alexander Monakov --- The trapping angle seems valid, but I have a really hard time understanding the DSE issue, and the preceding issue about disambiguation based on RTL aliasing. How would DSE optimize out 'd[5] = 1' in y

[Bug rtl-optimization/110237] gcc.dg/torture/pr58955-2.c is miscompiled by RTL scheduling after reload

2023-06-26 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110237 --- Comment #13 from Alexander Monakov --- (In reply to rguent...@suse.de from comment #12) > As explained in comment#3 the issue is related to the tree alias oracle > part that gets invoked on the MEM_EXPR for the load where there is > no infor

[Bug target/110273] [12/13/14 Regression] i686-w64-mingw32 with -mavx512f generates AVX instructions without stack alignment

2023-06-26 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273 --- Comment #8 from Alexander Monakov --- (In reply to Sam James from comment #7) > We keep getting quite a few reports of this downstream. Of this mingw32 stack realignment issue specifically, i.e. Wine breakage when AVX512 is enabled via CFLA

[Bug rtl-optimization/110237] gcc.dg/torture/pr58955-2.c is miscompiled by RTL scheduling after reload

2023-06-26 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110237 --- Comment #16 from Alexander Monakov --- (In reply to rguent...@suse.de from comment #14) > vectors of T and scalar T interoperate TBAA wise. What we disambiguate is > > int a[2]; > > int foo(int *p) > { > a[0] = 1; > *(v4si *)p = {0,0,

[Bug rtl-optimization/110237] gcc.dg/torture/pr58955-2.c is miscompiled by RTL scheduling after reload

2023-06-26 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110237 --- Comment #18 from Alexander Monakov --- (In reply to rguent...@suse.de from comment #17) > Yes, we do the same to loads. I hope that's not a common technique > though but I have to admit the vectorizer itself assesses whether it's > safe to

[Bug middle-end/110431] New: Incorrect disambiguation of wide accesess from store-merging or SLP

2023-06-27 Thread amonakov at gcc dot gnu.org via Gcc-bugs
-code Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: amonakov at gcc dot gnu.org Target Milestone: --- Inspired by bug 110237 comment 19: int b, a; int main() { int *pa = &a, *pb

[Bug rtl-optimization/110237] gcc.dg/torture/pr58955-2.c is miscompiled by RTL scheduling after reload

2023-06-27 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110237 --- Comment #21 from Alexander Monakov --- (In reply to rguent...@suse.de from comment #19) > But the size argument doesn't have anything to do with TBAA (and > may_alias is about TBAA). I don't think we have any way to circumvent > C object ac

[Bug target/110438] New: generating all-ones zmm needs dep-breaking pxor before ternlog

2023-06-27 Thread amonakov at gcc dot gnu.org via Gcc-bugs
Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: amonakov at gcc dot gnu.org Target Milestone: --- Target: x86_64-*-* VPTERNLOG is never a dependency-breaking instruction on existing x86 implementations, so generating a

[Bug target/110438] generating all-ones zmm needs dep-breaking pxor before ternlog

2023-06-27 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110438 --- Comment #1 from Alexander Monakov --- We might want to omit PXOR when optimizing for size.

[Bug rtl-optimization/110202] _mm512_ternarylogic_epi64 generates unnecessary operations

2023-06-27 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110202 --- Comment #7 from Alexander Monakov --- Note that vpxor serves as a dependency-breaking instruction (see PR 110438). So in negate1 we do the right thing for the wrong reasons, and in negate2 we can cause a substantial stall if the previous com

[Bug rtl-optimization/110202] _mm512_ternarylogic_epi64 generates unnecessary operations

2023-06-27 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110202 --- Comment #9 from Alexander Monakov --- (In reply to Hongtao.liu from comment #8) > > For this one, we can load *a into %zmm0 to avoid false_dependence. > > vmovdqau ZMMWORD PTR [rdi], zmm0 > vpternlogq zmm0, zmm0, zmm0, 85 Yes, since

[Bug target/110438] generating all-ones zmm needs dep-breaking pxor before ternlog

2023-07-04 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110438 --- Comment #3 from Alexander Monakov --- Patch available: https://inbox.sourceware.org/gcc-patches/8f73371d732237ed54ede44b7bd88...@ispras.ru/T/#u

[Bug target/110611] X86 is not honouring POINTERS_EXTEND_UNSIGNED in m32 code.

2023-07-10 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110611 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug c/44179] warn about sizeof(char) and sizeof('x')

2023-12-16 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44179 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug middle-end/113082] builtin transforms do not honor errno

2023-12-19 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113082 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug libstdc++/113159] More robust std::sort for silly comparator functions

2023-12-28 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113159 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug rtl-optimization/113280] Strange error for empty inline assembly with +X constraint

2024-01-09 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113280 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug ipa/113293] Incorrect code after inlining function containing extended asm

2024-01-09 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113293 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug target/113560] Strange code generated when optimizing a multiplication on x86_64

2024-01-24 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113560 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug ipa/115533] [12/13/14/15 regression] flac miscompiled with -O3 -march=znver2 -fipa-pta -fno-vect-cost-model since r12-3893-g6390c5047adb75

2024-06-24 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115533 --- Comment #20 from Alexander Monakov --- Sam, can you provide more context? It seems there is no downstream bugreport? How does the alleged miscompilation manifest? Note that effects of interplay of fp-contract=fast and vectorization can be p

[Bug ipa/115533] [12/13/14/15 regression] flac miscompiled with -O3 -march=znver2 -fipa-pta -fno-vect-cost-model since r12-3893-g6390c5047adb75

2024-06-24 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115533 --- Comment #22 from Alexander Monakov --- Similar to the RawTherapee issue, SLP opportunities are created by predcom, so either -fno-predictive-commoning or -fno-tree-slp-vectorize avoids numerical runaway on the small testcase.

[Bug ipa/115533] [12/13/14/15 regression] flac miscompiled with -O3 -march=znver2 -fipa-pta -fno-vect-cost-model since r12-3893-g6390c5047adb75

2024-07-03 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115533 --- Comment #23 from Alexander Monakov --- I suggest it to close this a dup of PR 106902 if there are no better ideas. By the way, in both cases SLP introduces vectors in a loop where scalar computations it's attempting to replace are not elimi

[Bug ipa/115533] [12/13/14/15 regression] flac miscompiled with -O3 -march=znver2 -fipa-pta -fno-vect-cost-model since r12-3893-g6390c5047adb75

2024-07-04 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115533 --- Comment #26 from Alexander Monakov --- (In reply to Richard Biener from comment #24) > > That's because of -fno-vect-cost-model, it wouldn't be vectorized otherwise. Thanks, I forgot. The testcase in PR 106902 was vectorized at plain -O3 b

[Bug target/114659] gcc miscompiles a __builtin_memcpy on i386, leading to wrong results for SNaN

2024-07-26 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114659 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug target/114659] gcc miscompiles a __builtin_memcpy on i386, leading to wrong results for SNaN

2024-07-26 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114659 --- Comment #15 from Alexander Monakov --- (In reply to Jakub Jelinek from comment #14) > (In reply to Alexander Monakov from comment #13) > > fldt does not convert (otherwise there's no way to spill/reload x87 > > registers). > > Doesn't it st

[Bug target/87832] AMD pipeline models are very costly size-wise

2024-10-13 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87832 --- Comment #15 from Alexander Monakov --- No, I didn't do older AMDs (btver2 & bdver3) and newer AMD (znver4) regressed this once again. Here's the current picture of top 10: nm -CS -t d --defined-only gcc/insn-automata.o | sed 's/^[0-9]* 0*//'

[Bug rtl-optimization/117239] wrong code at -O{s,2} with "-fno-inline -fschedule-insns" on x86_64-linux-gnu

2024-10-20 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117239 --- Comment #2 from Alexander Monakov --- Amazing bug. Note that it depends on high-order bits of return address overwriting o.i, so may need -no-pie -fno-pie to reproduce. Alternatively, changing 'if (o.i)' to 'if (o.i != 1)' allows to reproduc

[Bug rtl-optimization/117239] [12/13/14/15 Regression] wrong code at -O{s,2} with "-fno-inline -fschedule-insns" on x86_64-linux-gnu

2024-10-20 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117239 --- Comment #4 from Alexander Monakov --- (In reply to Alexander Monakov from comment #2) > Alternatively, > changing 'if (o.i)' to 'if (o.i != 1)' allows to reproduce with PIE as well. ^ I meant 'if (o.i ==

[Bug middle-end/117249] [12/13/14/15 Regression] --disable-checking is broken since r5-2450

2024-10-21 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117249 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug ipa/112601] [12/13/14/15 Regression] ICE in cgraph_node::verify_node(): error: invalid calls_comdat_local flag

2024-10-29 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112601 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug ipa/117432] New: [11/12/13/14/15 Regression] IPA ICF disregards types of variadic arguments

2024-11-03 Thread amonakov at gcc dot gnu.org via Gcc-bugs
: wrong-code Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: amonakov at gcc dot gnu.org Target Milestone: --- void bar(int tag, ...); void foo32(void) { bar(1, -1, 0); } void foo64(void) { bar(1

[Bug ipa/117432] [11/12/13/14/15 Regression] IPA ICF disregards types of variadic arguments

2024-11-03 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117432 --- Comment #1 from Alexander Monakov --- Created attachment 59528 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59528&action=edit executable testcase

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

2024-11-04 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117432 --- Comment #6 from Alexander Monakov --- compare_operand is used in compare_asm_inputs_outputs, so this is broken too: void foo32(void) { asm("" :: "r"(-1)); } void foo64(void) { asm("" :: "r"(-1LL)); }

[Bug middle-end/117249] [12/13/14/15 Regression] --disable-checking is broken since r5-2450

2024-10-23 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117249 --- Comment #12 from Alexander Monakov --- On IRC Jakub mentioned gcc_assert (token() == TYPEDEF) in gengtype and Richi further noted tree-ssa-loop-ivopts.cc:gcc_assert (use->op_p = gimple_call_arg_ptr (call, 0)); cgraph.cc: gcc_assert (++edge

[Bug rtl-optimization/117532] [15 Regression] Miscompile with -Os and -O0/1/2/3

2024-11-11 Thread amonakov at gcc dot gnu.org via Gcc-bugs
||amonakov at gcc dot gnu.org Status|NEW |RESOLVED --- Comment #4 from Alexander Monakov --- In all likelihood a dup of PR 117476. *** This bug has been marked as a duplicate of bug 117476 ***

[Bug rtl-optimization/117476] [15 regression] bad generated code at -O1 since r15-4991-g69bd93c167fefb

2024-11-11 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117476 --- Comment #22 from Alexander Monakov --- *** Bug 117532 has been marked as a duplicate of this bug. ***

[Bug target/117421] [RISCV] Use byte comparison instead of word comparison

2024-11-12 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117421 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug other/116947] --enable-checking=valgrind ignores failures during bootstrap

2024-10-03 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116947 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug c/117469] New: returns_twice on defined functions

2024-11-06 Thread amonakov at gcc dot gnu.org via Gcc-bugs
Assignee: unassigned at gcc dot gnu.org Reporter: amonakov at gcc dot gnu.org Target Milestone: --- It is not really possible to define (not just declare) a returns_twice function in C. The only possibilities I see are: 1) a "naked" function, on targets where that's s

[Bug c/117469] returns_twice on defined functions

2024-11-06 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117469 --- Comment #2 from Alexander Monakov --- (In reply to Xi Ruoyao from comment #1) > So if the tail-call uses [[musttail]] the alternative 3 should be "fine"? Yes, plus annotating the callees that return twice with the attribute is still require

[Bug c/117469] returns_twice on defined functions

2024-11-21 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117469 --- Comment #4 from Alexander Monakov --- The code in comment #3 is invalid: siglongjmp is called when the state saved in env is no longer valid: plat_setjmp has returned (and the stack slot where its return address is stored is overwritten).

[Bug target/117926] [14/15 Regression] emits 3dnow (MMX) instruction from autovectorized GIMPLE without emms at -O2 since r14-2786-gade30fad6669e5

2024-12-05 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117926 --- Comment #5 from Alexander Monakov --- Thanks, here's a variant of the small testcase that fails on gcc-14 too, just needed to make the integer field the first in the struct: struct s { int i[2]; float f[2]; double d; }; void f(s

[Bug tree-optimization/118198] tail merge/cross jump should not merge abort

2025-01-03 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118198 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug c/118818] Optimization of divps to rcpps + newton can cause slow down

2025-02-10 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118818 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug target/117926] New: [15 Regression] emits MMX from autovectorized GIMPLE without emms at -O2

2024-12-05 Thread amonakov at gcc dot gnu.org via Gcc-bugs
: wrong-code Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: amonakov at gcc dot gnu.org Target Milestone: --- Target: x86_64-*-* Minimized from Firefox mysteriously segfaulting when built

[Bug tree-optimization/118570] -O2 much faster than -O3 for Romberg's method

2025-01-20 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118570 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

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

2025-01-17 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117432 --- Comment #10 from Alexander Monakov --- Yeah, I would expect compare_operand to be the proper place for a fix, not its callers.

[Bug target/118342] `a == 0 ? 32 : __builtin_ctz(a)` for Intel and AMD cores could be implemented even without BMI1

2025-01-09 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118342 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug tree-optimization/119103] shift not demotated when shift amount range is known

2025-03-04 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug target/106902] [12/13/14/15 Regression] Program compiled with -O3 -mfma produces different result

2025-02-28 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106902 --- Comment #36 from Alexander Monakov --- We can flip the default from =fast to =on for -std=gnuXX any time we like, but it must remain at =off for =std=cXX as long as STDC FP_CONTRACT pragma is not implemented. I have not attempted any mass r

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-21 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #31 from Alexander Monakov --- I am certainly missing some interesting history here, because on one hand, I see that a.out uses call-pop combo in function prologue to find out current PC, and then uses %ebx-relative addressing in PIC

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-20 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #23 from Alexander Monakov --- That's probably just copying existing behavior from 32-bit x86. Can we preserve previous behavior that under -fpic -mno-direct-extern-access mcount is called via GOT (and else emit mcount@PLT if -fpic

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-20 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #29 from Alexander Monakov --- (In reply to Alexander Monakov from comment #21) > GOT indirection for mcount has been there from the very beginning: > https://gcc.gnu.org/cgit/gcc/tree/gcc/config/i386/i386. > h?id=c98f874233428d7e6ba

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-21 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #30 from Alexander Monakov --- Sorry, sent too soon: a.out had the concept of PLT as well as GOT: https://gcc.gnu.org/cgit/gcc/tree/gcc/config/i386/i386.c?id=c98f874233428d7e6ba83def7842fd703ac0ddf1#n820

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-21 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #34 from Alexander Monakov --- We have -mcmodel=kernel already, which is incompatible with -fpic. Ard, where is -fpic in the kernel context coming from? Kernel's top-level Makefile passes -fno-PIE, and arch/x86/Makefile passes -mcmo

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-21 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #38 from Alexander Monakov --- (In reply to Ard Biesheuvel from comment #37) > Yes, we can drop -mcmodel=kernel, and use -mcmodel=small instead. This is > why I'm not keen on relying on that - it is ill-defined and there is really >

[Bug c++/119387] [14/15 Regression] Regression in performance by a factor of 6 when building with debugging symbols since r14-5979

2025-03-21 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119387 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-21 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #40 from Alexander Monakov --- > In Linux, we don't even bother with PIC codegen, even though we link with > -pie. Earlier you said that building with -fPIC may be desirable, and your patch was dealing with PIC codegen in GCC for m

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-20 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #21 from Alexander Monakov --- GOT indirection for mcount has been there from the very beginning: https://gcc.gnu.org/cgit/gcc/tree/gcc/config/i386/i386.h?id=c98f874233428d7e6ba83def7842fd703ac0ddf1#n623

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-21 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #36 from Alexander Monakov --- Today, gcc rejects -fpic -mcmodel=kernel on the command line though, and it doesn't look like you can drop -mcmodel=kernel, so... was there some plan for dealing with that? (considering new flags to co

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-24 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #42 from Alexander Monakov --- > In Linux, we don't even bother with PIC codegen, even though we link with > -pie. My git-grep for that is coming up empty, where should I look? > ... on x86_64, where PIC and non-PIC codegen are r

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-25 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #46 from Alexander Monakov --- A small correction: -static-pie is not a linker option, it's a gcc (compiler driver) option, which it decomposes into -static -pie --no-dynamic-linker -z text for the linker; --no-dynamic-linker was add

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-24 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #44 from Alexander Monakov --- (In reply to Ard Biesheuvel from comment #43) > arch/arm64/Makefile specifies '-shared' for the linker flags, but does not > pass -fpic of -fpie to the compiler. We used to pass '-pie -shared' but that

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

2025-03-19 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119368 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-20 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #19 from Alexander Monakov --- The question is why prior to your patch GCC emitted mcount@GOT (i.e. avoiding the PLT trampoline for mcount on purpose), going all the way back to gcc-3.4 (and probably further).

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-04-01 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #54 from Alexander Monakov --- I think the x86_64 behavior is simply copied as-is from i386. On i386, there was a time when Glibc wouldn't preserve eax+ecx+edx in the PLT trampoline, but preserving those became necessary when GCC ex

[Bug tree-optimization/119733] store-merging increases alignment

2025-04-11 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119733 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-31 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #51 from Alexander Monakov --- Michael, can you give your ack/nack for Ard's proposal in comment #24 (the second variant, I guess keying off -m[no-]direct-extern-access doesn't make sense here). I think it properly addresses what you

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-28 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #49 from Alexander Monakov --- Aha, and I see the kernel employs the trick of preincluding a file containing ' '#pragma GCC visibility push(hidden)' when building PIE objects since 2020. So the mcount-emitting macro in the i386 backe

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-28 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #47 from Alexander Monakov --- (In reply to Ard Biesheuvel from comment #43) > Non-PIC might be more efficient, but there are cases where we cannot use it. > The early startup code on x86 runs from a different virtual mapping than it

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-20 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #25 from Alexander Monakov --- (In reply to Ard Biesheuvel from comment #24) > - never emit 'call mcount' > - emit 'call *mcount@GOTPCREL(%rip)' if -fno-plt > - emit 'call mcount@PLT' otherwise As discussed, gcc was always using GOT

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-20 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-03-20 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #15 from Alexander Monakov --- Any idea why prior to introduction of this bug, gcc always emitted a GOT-indirect call for mcount? It looks like it is avoiding lazy PLT resolver, but why is that necessary?

[Bug target/119596] x86: too eager use of rep movsq/rep stosq for inlined ops

2025-04-03 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119596 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug target/119386] [14/15 Regression][x64] Shared libraries can no longer be compiled with profiling

2025-04-03 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386 --- Comment #56 from Alexander Monakov --- I think you mean -fno-plt, not -mno-plt (here and your previous comment)? Ideally we would be able to express a relocation to PLT, but without admitting lazy binding (i.e. the trampoline will be in .pl

[Bug c/119774] New: Missing -Wcast-align for reduced-alignment types

2025-04-13 Thread amonakov at gcc dot gnu.org via Gcc-bugs
Component: c Assignee: unassigned at gcc dot gnu.org Reporter: amonakov at gcc dot gnu.org Target Milestone: --- Noticed by Evan Martin. typedef int int_u __attribute__((aligned(1))); void f(int *); void g(int_u *p) { f(p); } -Wcast-align should warn on the implicit cast

[Bug c/119845] Something triggered by -march=native create code that is not compliant with floating point standards

2025-04-17 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119845 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org

[Bug c/90253] no warning for cv-qualified selectors in _Generic

2025-04-21 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90253 --- Comment #3 from Alexander Monakov --- clang-15 and newer warn for this, enabled by default: warning: due to lvalue conversion of the controlling expression, association of type 'const char' will never be selected because it is qualified [-Wu

<    7   8   9   10   11   12