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/113766] ICE: in generate_insn, at config/riscv/riscv-vector-builtins.cc:4186 with (invalid?) __riscv_vfredosum_tu()
Date: Wed, 07 Feb 2024 01:19:06 +0000	[thread overview]
Message-ID: <bug-113766-4-264zIqqXsv@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113766-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 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:db5c3f6d952bc3950d23c0a6be4e8ec9147ef752

commit r14-8834-gdb5c3f6d952bc3950d23c0a6be4e8ec9147ef752
Author: Pan Li <pan2.li@intel.com>
Date:   Tue Feb 6 15:35:02 2024 +0800

    RISC-V: Bugfix for RVV overloaded intrinisc ICE when empty args

    There is one corn case when similar as below example:

    void test (void)
    {
      __riscv_vfredosum_tu ();
    }

    It will meet ICE because of the implement details of overloaded function
    in gcc.  According to the rvv intrinisc doc, we have no such overloaded
    function with empty args.  Unfortunately, we register the empty args
    function as overloaded for avoiding conflict.  Thus, there will be actual
    one register function after return NULL_TREE back to the middle-end,
    and finally result in ICE when expanding.  For example:

    1. First we registered void __riscv_vfredmax () as the overloaded function.
    2. Then resolve_overloaded_builtin (this func) return NULL_TREE.
    3. The functions register in step 1 bypass the args check as empty args.
    4. Finally, fall into expand_builtin with empty args and meet ICE.

    Here we report error when overloaded function with empty args.  For
example:

    test.c: In function 'foo':
    test.c:8:3: error: no matching function call to '__riscv_vfredosum_tu' with
empty args
        8 |   __riscv_vfredosum_tu();
          |   ^~~~~~~~~~~~~~~~~~~~

    Below test are passed for this patch.

    * The riscv regression tests.

            PR target/113766

    gcc/ChangeLog:

            * config/riscv/riscv-protos.h (resolve_overloaded_builtin): Adjust
            the signature of func.
            * config/riscv/riscv-c.cc (riscv_resolve_overloaded_builtin):
Ditto.
            * config/riscv/riscv-vector-builtins.cc
(resolve_overloaded_builtin): Make
            overloaded func with empty args error.

    gcc/testsuite/ChangeLog:

            * gcc.target/riscv/rvv/base/pr113766-1.c: New test.
            * gcc.target/riscv/rvv/base/pr113766-2.c: New test.

    Signed-off-by: Pan Li <pan2.li@intel.com>

  parent reply	other threads:[~2024-02-07  1:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 11:57 [Bug target/113766] New: " zsojka at seznam dot cz
2024-02-06  0:44 ` [Bug target/113766] " pan2.li at intel dot com
2024-02-07  1:19 ` cvs-commit at gcc dot gnu.org [this message]
2024-02-08  6:52 ` 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-113766-4-264zIqqXsv@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).