public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pc.wang at linux dot alibaba.com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/102326] New: ICE in tree_to_uhwi, at tree.c:4520
Date: Tue, 14 Sep 2021 12:53:14 +0000	[thread overview]
Message-ID: <bug-102326-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 102326
           Summary: ICE in tree_to_uhwi, at tree.c:4520
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pc.wang at linux dot alibaba.com
  Target Milestone: ---

Created attachment 51459
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51459&action=edit
A patch that may fix this bug

If there exists static local variable of variable-length vector type(like types
in AARCH64 SVE and RISCV Vector Extension) in C++ template, like:

```
#include <arm_sve.h>
template <int N>
void f()
{
    int i = 0;
    static svbool_t pg = svwhilelt_b64(0, N);
}

int main(int argc, char **argv)
{
    f<2>();
    return 0;
}
```

GCC raises an ICE like:

```
static-var-in-template.cpp:14:1: internal compiler error: in tree_to_uhwi, at
tree.h:4520
   14 | }
      | ^
```

And here is the version of GCC:

```
Using built-in specs.
COLLECT_GCC=aarch64-none-linux-gnu-g++
COLLECT_LTO_WRAPPER=/lhome/wangpc/software/arm/bin/../libexec/gcc/aarch64-none-linux-gnu/10.2.1/lto-wrapper
Target: aarch64-none-linux-gnu
Configured with:
/tmp/dgboter/bbs/build04--cen7x86_64/buildbot/cen7x86_64--aarch64-none-linux-gnu/build/src/gcc/configure
--target=aarch64-none-linux-gnu --prefix=
--with-sysroot=/aarch64-none-linux-gnu/libc
--with-build-sysroot=/tmp/dgboter/bbs/build04--cen7x86_64/buildbot/cen7x86_64--aarch64-none-linux-gnu/build/build-aarch64-none-linux-gnu/install//aarch64-none-linux-gnu/libc
--with-bugurl=https://bugs.linaro.org/ --enable-gnu-indirect-function
--enable-shared --disable-libssp --disable-libmudflap --enable-checking=release
--enable-languages=c,c++,fortran
--with-gmp=/tmp/dgboter/bbs/build04--cen7x86_64/buildbot/cen7x86_64--aarch64-none-linux-gnu/build/build-aarch64-none-linux-gnu/host-tools
--with-mpfr=/tmp/dgboter/bbs/build04--cen7x86_64/buildbot/cen7x86_64--aarch64-none-linux-gnu/build/build-aarch64-none-linux-gnu/host-tools
--with-mpc=/tmp/dgboter/bbs/build04--cen7x86_64/buildbot/cen7x86_64--aarch64-none-linux-gnu/build/build-aarch64-none-linux-gnu/host-tools
--with-isl=/tmp/dgboter/bbs/build04--cen7x86_64/buildbot/cen7x86_64--aarch64-none-linux-gnu/build/build-aarch64-none-linux-gnu/host-tools
--enable-fix-cortex-a53-843419 --with-pkgversion='GNU Toolchain for the
A-profile Architecture 10.2-2020.11 (arm-10.16)'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.1 20201103 (GNU Toolchain for the A-profile Architecture
10.2-2020.11 (arm-10.16)) 
```

The lack of type checking (defined by hook `TARGET_VERIFY_TYPE_CONTEXT`) after
instantiation is the reason, since SVE/RVV types can't be static.

             reply	other threads:[~2021-09-14 12:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14 12:53 pc.wang at linux dot alibaba.com [this message]
2021-09-17  8:08 ` [Bug target/102326] " pc.wang at linux dot alibaba.com
2021-09-18  5:57 ` pc.wang at linux dot alibaba.com
2021-09-22  4:24 ` pc.wang at linux dot alibaba.com
2021-09-22  5:38 ` [Bug c++/102326] " pinskia 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-102326-4@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).