[Bug target/119847] [13/14/15 Regression] RISC-V:GCC fail to optimize repeated patterns in volatile operations

2025-05-19 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119847 --- Comment #3 from Huaqi --- This issue still existed in gcc truck(16) version, will it be optimized, or is there any patch?

[Bug target/120344] New: code size increase with gcc 13 due to repeated loading of higher address in assembly for riscv

2025-05-18 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120344 Bug ID: 120344 Summary: code size increase with gcc 13 due to repeated loading of higher address in assembly for riscv Product: gcc Version: 14.2.1 Status: UNCONFIRMED

[Bug middle-end/119280] Unexpected inline asm rdcycle code misplaced cause wrong cycle calculation

2025-03-13 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119280 --- Comment #9 from Huaqi --- Okay, thank you Andrew and Sam for your explaination.

[Bug middle-end/119280] Unexpected inline asm rdcycle code misplaced cause wrong cycle calculation

2025-03-13 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119280 --- Comment #5 from Huaqi --- And for llvm part, the author topperc is looking into this issue, and try to find a way to fix it, see https://github.com/llvm/llvm-project/issues/130033#issuecomment-2707711817

[Bug middle-end/119280] Unexpected inline asm rdcycle code misplaced cause wrong cycle calculation

2025-03-13 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119280 --- Comment #4 from Huaqi --- (In reply to Andrew Pinski from comment #2) > res = a[0] * a[0]; > __asm volatile("rdcycle %0" : "=r"(end_cycle) : "r"(res) : "memory"); > > Will cause the second rdcycle to stay after the mult. > > Otherw

[Bug middle-end/119280] Unexpected inline asm rdcycle code misplaced cause wrong cycle calculation

2025-03-13 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119280 --- Comment #3 from Huaqi --- (In reply to Andrew Pinski from comment #1) > https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Extended-Asm.html#Volatile-1 > > Note that the compiler can move even volatile asm instructions relative to > other code,

[Bug c/119280] New: Unexpected inline asm rdcycle code misplaced cause wrong cycle calculation

2025-03-13 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119280 Bug ID: 119280 Summary: Unexpected inline asm rdcycle code misplaced cause wrong cycle calculation Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: nor

[Bug target/118827] riscv scalar and vector are all saved when __attribute__((interrupt)) used

2025-02-11 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118827 --- Comment #4 from Huaqi --- But why interrupt attributed function behavior are different from normal function? see my previous comment https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118827#c2

[Bug target/118827] riscv scalar and vector are all saved when __attribute__((interrupt)) used

2025-02-10 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118827 --- Comment #2 from Huaqi --- If this file is compiled with O3, it will be inlined and less fp/vector register will be used, but if I pass -fno-inline, then all fp and vector registers are then still saved, since it called a subfunction, but if

[Bug c/118827] New: riscv scalar and vector are all saved when __attribute__((interrupt)) used

2025-02-10 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118827 Bug ID: 118827 Summary: riscv scalar and vector are all saved when __attribute__((interrupt)) used Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: nor

[Bug target/118384] unexpected call to __muldi3 generated for riscv target

2025-01-09 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118384 --- Comment #6 from Huaqi --- Thanks Kito, this `-fno-ssa-phiopt` option also works.

[Bug target/118384] unexpected call to __muldi3 generated for riscv target

2025-01-09 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118384 --- Comment #4 from Huaqi --- Thanks Andrew, it is clear to me now. Do you know how it can be avoided? Since I may want to implement my own `__muldi3` function instead of generating a libcall.

[Bug c/118384] unexpected call to __muldi3 generated for riscv target

2025-01-08 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118384 --- Comment #1 from Huaqi --- This issue also present in arm-eabi-gcc toolchain 14.x, but not present in 13.x. compiler option chosen is -Os -mcpu=cortex-m0 chose m0 due it don't have a multiply hw unit see https://godbolt.org/z/941TbMKGc 14

[Bug c/118384] New: unexpected call to __muldi3 generated for riscv target

2025-01-08 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118384 Bug ID: 118384 Summary: unexpected call to __muldi3 generated for riscv target Product: gcc Version: 14.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Co

[Bug tree-optimization/118175] Unable to do auto vectorization for matrix multiply due to aliasing of matrix's

2024-12-23 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118175 --- Comment #4 from Huaqi --- (In reply to Andrew Pinski from comment #3) > (In reply to Huaqi from comment #2) > > (In reply to Andrew Pinski from comment #1) > > > Looks like an alias issue. > > > Changing the matrix definitions to: > > > exte

[Bug tree-optimization/118175] Unable to do auto vectorization for rv32imafc_zve32f_zvl128b for matrix like c code

2024-12-23 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118175 --- Comment #2 from Huaqi --- (In reply to Andrew Pinski from comment #1) > Looks like an alias issue. > Changing the matrix definitions to: > extern float matA[], matB[], matC[]; > > > Allows GCC to vectorize the loop even for x86_64. Yes, i

[Bug target/118175] New: Unable to do auto vectorization for rv32imafc_zve32f_zvl128b for matrix like c code

2024-12-22 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118175 Bug ID: 118175 Summary: Unable to do auto vectorization for rv32imafc_zve32f_zvl128b for matrix like c code Product: gcc Version: 15.0 Status: UNCONFIRMED Seve

[Bug target/117831] [RISCV] A dead loop occurs when calculating the multiplication of two uint64 integers under rv32 -Os

2024-12-01 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117831 Huaqi changed: What|Removed |Added CC||fanghuaqi at vip dot qq.com --- Comment #5 from

[Bug target/116883] Compile cpp code with rv32imafc_zve32f failed

2024-10-14 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116883 Huaqi changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug target/116883] Compile cpp code with rv32imafc_zve32f failed

2024-10-08 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116883 --- Comment #4 from Huaqi --- (In reply to Li Pan from comment #3) > I think xuli is working on this issue. As you know, the first week of Oct is > the National Holiday. Ok, thanks, just confirm this issue is acked.

[Bug target/116883] Compile cpp code with rv32imafc_zve32f failed

2024-10-08 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116883 --- Comment #2 from Huaqi --- Hi there, I tested with godbolt.org with latest gcc15(trunk), this issue still exists, and gcc14.2 still fail. /opt/compiler-explorer/riscv32/gcc-trunk-20241008/riscv32-unknown-linux-gnu/lib/gcc/riscv32-unknown-lin

[Bug target/116883] Compile cpp code with rv32imafc_zve32f failed

2024-09-28 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116883 --- Comment #1 from Huaqi --- but when I compile it by adding _zvl64b using command line riscv64-unknown-elf-gcc -march=rv32imafc_zve32f_zvl64b -mabi=ilp32f -c tmp.cpp it will not report any error

[Bug target/116883] New: Compile cpp code with rv32imafc_zve32f failed

2024-09-28 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116883 Bug ID: 116883 Summary: Compile cpp code with rv32imafc_zve32f failed Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ta

[Bug target/113715] RISC-V: If the Zcmp is enabled, the a0 register operates abnormally when the program returns

2024-07-11 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113715 --- Comment #8 from Huaqi --- Hi Fei Gao, Could you also send patch to this branch https://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/vendors/riscv/heads/gcc-14-with-riscv-opts , this patch is not yet on this branch. Thanks

[Bug target/113715] RISC-V: If the Zcmp is enabled, the a0 register operates abnormally when the program returns

2024-02-07 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113715 --- Comment #3 from Huaqi --- (In reply to Andrew Pinski from comment #2) > Yes this is where shrink wrapping incorrects incorrectly with > riscv_zcmp_can_use_popretz optimization. Basically popretz should be > disabled for shrink wrapped functi

[Bug target/113715] RISC-V: If the Zcmp is enabled, the a0 register operates abnormally when the program returns

2024-02-05 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113715 Huaqi changed: What|Removed |Added CC||fanghuaqi at vip dot qq.com --- Comment #1 from

[Bug target/112537] Is there a way to disable cpymem pass for rvv

2023-11-14 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112537 --- Comment #5 from Huaqi --- (In reply to JuzheZhong from comment #4) > You mean you want to disable it when disabling auto-vectorization ? Yes, I think this could be better, so we can control whether vector instruction should be generated, an

[Bug target/112537] Is there a way to disable cpymem pass for rvv

2023-11-14 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112537 --- Comment #3 from Huaqi --- Hi Juzhe, thanks for the help, could it be controlled by --param=riscv-autovec-preference= option, so if I want to enable cpymem optimization, I can enable it by auto vectorzation. Thanks

[Bug c/112537] New: Is there a way to disable cpymem pass for rvv

2023-11-14 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112537 Bug ID: 112537 Summary: Is there a way to disable cpymem pass for rvv Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c

[Bug target/111927] RISC-V: internal compiler error: in merge, at config/riscv/riscv-vsetvl.cc:1997

2023-10-23 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111927 Huaqi changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug target/111927] RISC-V: internal compiler error: in merge, at config/riscv/riscv-vsetvl.cc:1997

2023-10-22 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111927 --- Comment #2 from Huaqi --- (In reply to JuzheZhong from comment #1) > Confirm VSETVL PASS issue. > > We just refactored it recently. > > I will fix it. Thanks for report it. Thanks for your reply, wait for the refactorization finished.

[Bug target/111927] New: RISC-V: internal compiler error: in merge, at config/riscv/riscv-vsetvl.cc:1997

2023-10-22 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111927 Bug ID: 111927 Summary: RISC-V: internal compiler error: in merge, at config/riscv/riscv-vsetvl.cc:1997 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity

[Bug bootstrap/109460] Build gcc for win32 failed in gcc13 master branch

2023-04-12 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109460 --- Comment #35 from Huaqi --- OK, thanks

[Bug bootstrap/109460] Build gcc for win32 failed in gcc13 master branch

2023-04-12 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109460 --- Comment #25 from Huaqi --- Hi here is what I tested in Ubuntu 18.04 root@1aae7bc8a1f6:/work/LocalBuilds/2023.04-eng2_20230412_014350/build-gcc-newlib-stage1/gcc# i686-w64-mingw32-gcc -nostdlib -r utf8rc-mingw32.o sym-mingw32.o -o utf8-mingw

[Bug bootstrap/109460] Build gcc for win32 failed in gcc13 master branch

2023-04-12 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109460 --- Comment #22 from Huaqi --- (In reply to Eric Botcazou from comment #20) > Can you add -nostdlib alongside -r in the command? Hi, I have tried this, it works.

[Bug bootstrap/109460] Build gcc for win32 failed in gcc13 master branch

2023-04-12 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109460 --- Comment #21 from Huaqi --- Hi, I tried to change it like this $ git diff diff --git a/gcc/config/i386/x-mingw32-utf8 b/gcc/config/i386/x-mingw32-utf8 index 2783dd259a6..e4a6c7f3d3a 100644 --- a/gcc/config/i386/x-mingw32-utf8 +++ b/gcc/conf

[Bug bootstrap/109460] Build gcc for win32 failed in gcc13 master branch

2023-04-12 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109460 --- Comment #17 from Huaqi --- Hi, I have apply this patch, but it failed like what I do before. libcommon.a ../libcpp/libcpp.a -liconv ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -L/work/Loca

[Bug bootstrap/109460] Build gcc for win32 failed in gcc13 master branch

2023-04-12 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109460 --- Comment #15 from Huaqi --- Hello, this is the version I am using. OS environment: root@1aae7bc8a1f6:/work# cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=18.04 DISTRIB_CODENAME=bionic DISTRIB_DESCRIPTION="Ubuntu 18.04.6 LTS" packa

[Bug bootstrap/109460] Build gcc for win32 failed in gcc13 master branch

2023-04-11 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109460 --- Comment #13 from Huaqi --- Hello, I didn't take a try with other mingw gcc version, locally I just revert 304c7d44a2212e6fd618587331cea2c266dc10bf commit, then it works for me. Thanks Huaqi

[Bug bootstrap/109460] Build gcc for win32 failed in gcc13 master branch

2023-04-11 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109460 --- Comment #12 from Huaqi --- Hello, this is the command used to configure gcc /work/gcc/configure --target=riscv64-unknown-elf --host=i686-w64-mingw32 --prefix=/work/LocalInstall/win32/newlibc/2023.04-eng2/gcc --disable-shared --di sable-thre

[Bug c/109460] Build gcc for win32 failed in gcc13 master branch

2023-04-11 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109460 --- Comment #9 from Huaqi --- Hi, Costas Argyris, I am using this repo to help build toolchain, the repo link is here: https://github.com/riscv-collab/riscv-gnu-toolchain clone this source code and its submodule, and change gcc to upstream ve

[Bug c/109460] Build gcc for win32 failed in gcc13 master branch

2023-04-10 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109460 --- Comment #6 from Huaqi --- I think it might be introduced by this commit https://github.com/gcc-mirror/gcc/commit/304c7d44a2212e6fd618587331cea2c266dc10bf, since I tested this commit https://github.com/gcc-mirror/gcc/commit/4872e46e080c6695df

[Bug bootstrap/109461] build gcc for riscv target failed with `execvp: /bin/sh: Argument list too long error when using with --with-multilib-generator`

2023-04-09 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109461 --- Comment #3 from Huaqi --- Thanks Kito, maybe you can add more examples in this script https://github.com/gcc-mirror/gcc/blob/master/gcc/config/riscv/multilib-generator and in this doc https://github.com/riscv-collab/riscv-gnu-toolchain#build

[Bug c/109461] New: build gcc for riscv target failed with `execvp: /bin/sh: Argument list too long error when using with --with-multilib-generator`

2023-04-09 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109461 Bug ID: 109461 Summary: build gcc for riscv target failed with `execvp: /bin/sh: Argument list too long error when using with --with-multilib-generator` Product: gcc

[Bug c/109460] New: Build gcc for win32 failed in gcc13 master branch

2023-04-09 Thread fanghuaqi at vip dot qq.com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109460 Bug ID: 109460 Summary: Build gcc for win32 failed in gcc13 master branch Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component