public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/113429] RISC-V: SPEC2017 527 cam4 miscompilation in autovec VLA build
Date: Thu, 18 Jan 2024 01:31:02 +0000	[thread overview]
Message-ID: <bug-113429-4-X1AYJsTgvc@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113429-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113429

--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pan Li <panli@gcc.gnu.org>:

https://gcc.gnu.org/g:e935c0662fe6301d524c54bb5bd75e923abb61e9

commit r14-8199-ge935c0662fe6301d524c54bb5bd75e923abb61e9
Author: Juzhe-Zhong <juzhe.zhong@rivai.ai>
Date:   Thu Jan 18 09:08:15 2024 +0800

    RISC-V: Add has compatible check for conflict vsetvl fusion

    V3: Rebase to trunk and commit it.

    This patch fixes SPEC2017 cam4 mismatch issue due to we miss has compatible
check
    for conflict vsetvl fusion.

    Buggy assembler before this patch:

    .L69:
            vsetvli a5,s1,e8,mf4,ta,ma                  -> buggy vsetvl
            vsetivli        zero,8,e8,mf2,ta,ma
            vmv.v.i v1,0
            vse8.v  v1,0(a5)
            j       .L37
    .L68:
            vsetvli a5,s1,e8,mf4,ta,ma                  -> buggy vsetvl
            vsetivli        zero,8,e8,mf2,ta,ma
            addi    a3,a5,8
            vmv.v.i v1,0
            vse8.v  v1,0(a5)
            vse8.v  v1,0(a3)
            addi    a4,a4,-16
            li      a3,8
            bltu    a4,a3,.L37
            j       .L69
    .L67:
            vsetivli        zero,8,e8,mf2,ta,ma
            vmv.v.i v1,0
            vse8.v  v1,0(a5)
            addi    a5,sp,56
            vse8.v  v1,0(a5)
            addi    s4,sp,64
            addi    a3,sp,72
            vse8.v  v1,0(s4)
            vse8.v  v1,0(a3)
            addi    a4,a4,-32
            li      a3,16
            bltu    a4,a3,.L36
            j       .L68

    After this patch:

    .L63:
            ble     s1,zero,.L49
            slli    a4,s1,3
            li      a3,32
            addi    a5,sp,48
            bltu    a4,a3,.L62
            vsetivli        zero,8,e8,mf2,ta,ma
            vmv.v.i v1,0
            vse8.v  v1,0(a5)
            addi    a5,sp,56
            vse8.v  v1,0(a5)
            addi    s4,sp,64
            addi    a3,sp,72
            vse8.v  v1,0(s4)
            addi    a4,a4,-32
            addi    a5,sp,80
            vse8.v  v1,0(a3)
    .L35:
            li      a3,16
            bltu    a4,a3,.L36
            addi    a3,a5,8
            vmv.v.i v1,0
            addi    a4,a4,-16
            vse8.v  v1,0(a5)
            addi    a5,a5,16
            vse8.v  v1,0(a3)
    .L36:
            li      a3,8
            bltu    a4,a3,.L37
            vmv.v.i v1,0
            vse8.v  v1,0(a5)

    Tested on both RV32/RV64 no regression, Ok for trunk ?

            PR target/113429

    gcc/ChangeLog:

            * config/riscv/riscv-vsetvl.cc
(pre_vsetvl::earliest_fuse_vsetvl_info): Fix bug.

    gcc/testsuite/ChangeLog:

            * gcc.target/riscv/rvv/vsetvl/vlmax_conflict-4.c: Adapt test.
            * gcc.target/riscv/rvv/vsetvl/vlmax_conflict-5.c: Ditto.

  parent reply	other threads:[~2024-01-18  1:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 20:37 [Bug target/113429] New: " vineetg at gcc dot gnu.org
2024-01-16 20:39 ` [Bug target/113429] " vineetg at gcc dot gnu.org
2024-01-16 20:42 ` vineetg at gcc dot gnu.org
2024-01-16 20:58 ` vineetg at gcc dot gnu.org
2024-01-16 22:29 ` juzhe.zhong at rivai dot ai
2024-01-17  2:02 ` juzhe.zhong at rivai dot ai
2024-01-17  2:40 ` vineetg at gcc dot gnu.org
2024-01-17 22:24 ` juzhe.zhong at rivai dot ai
2024-01-17 22:45 ` vineetg at gcc dot gnu.org
2024-01-18  1:31 ` cvs-commit at gcc dot gnu.org [this message]
2024-01-18  1:33 ` juzhe.zhong at rivai dot ai
2024-01-19  3:23 ` vineetg at gcc dot gnu.org
2024-01-24  1:19 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-113429-4-X1AYJsTgvc@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).