public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101303] New: ICE from modified lambda-generic-100362.C test case from bug 100362
@ 2021-07-02 18:07 enolan at alumni dot cmu.edu
  2021-07-02 18:27 ` [Bug c++/101303] " enolan at alumni dot cmu.edu
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: enolan at alumni dot cmu.edu @ 2021-07-02 18:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101303
           Summary: ICE from modified lambda-generic-100362.C test case
                    from bug 100362
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: enolan at alumni dot cmu.edu
  Target Milestone: ---

When I was checking whether the fix for bug 100362 worked, I noticed that
although it fixed the minimal test case I provided, the original code from
which I'd minified it still crashed GCC. After some diffing I discovered that
the following slight modification of the gcc test case,
lambda-generic-100362.C, still caused an ICE. The cpp file I used is as
follows:

template <class>
struct Qux {
  struct A { } a_;
  A f();

  void AsyncOp() {
    [this](auto) {
      using Foo = decltype(a_);
      struct local : Foo {};
      local ptr;
    }(0);
  }
};

void corge() {
  Qux<int> qux;
  qux.AsyncOp();
}

The changes from the original test case are that "struct local" inherits with a
"using" declaration instead of inheriting from "decltype(a_)" directly, and
that the lambda captures "this".

Although the version details included below are from a build of gcc from the
latest master, I also tested this with GCC 9.3.0, and it ICEd that version as
well.

> the exact version of GCC

I used Spack to build GCC from commit hash 58b735. (I accidentally tagged it
"11.1.0.58b735" even though it's 12.0.0.)

gcc version 12.0.0 20210701 (experimental) (Spack GCC)

> the system type

Ubuntu 21.04

> the options given when GCC was configured/built

Configured with:
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/configure
--prefix=/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb
--with-pkgversion='Spack GCC'
--with-bugurl=https://github.com/spack/spack/issues --disable-multilib
--enable-languages=c,c++,fortran --disable-nls --with-system-zlib
--with-zstd-include=/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/zstd-1.4.9-g5e5ekytpmwt4p2s2whwo5n23uezvaau/include
--with-zstd-lib=/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/zstd-1.4.9-g5e5ekytpmwt4p2s2whwo5n23uezvaau/lib
--with-mpfr-include=/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/mpfr-4.1.0-wkdcn7axxshpddf24rlmrgbnl4b5x4uj/include
--with-mpfr-lib=/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/mpfr-4.1.0-wkdcn7axxshpddf24rlmrgbnl4b5x4uj/lib
--with-gmp-include=/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/gmp-6.2.1-y5nxi6djabr65jjm4pquijfju46tioyl/include
--with-gmp-lib=/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/gmp-6.2.1-y5nxi6djabr65jjm4pquijfju46tioyl/lib
--with-mpc-include=/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/mpc-1.1.0-v6jniwtyay66af7sk43c75njjrsoyjns/include
--with-mpc-lib=/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/mpc-1.1.0-v6jniwtyay66af7sk43c75njjrsoyjns/lib
--without-isl
--with-stage1-ldflags='-Wl,-rpath,/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/lib
-Wl,-rpath,/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/lib64
-Wl,-rpath,/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/gmp-6.2.1-y5nxi6djabr65jjm4pquijfju46tioyl/lib
-Wl,-rpath,/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/mpfr-4.1.0-wkdcn7axxshpddf24rlmrgbnl4b5x4uj/lib
-Wl,-rpath,/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/mpc-1.1.0-v6jniwtyay66af7sk43c75njjrsoyjns/lib
-Wl,-rpath,/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/zlib-1.2.11-xfc275gqwmrd3cwbjnqbnqx2u5gz444l/lib
-Wl,-rpath,/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/zstd-1.4.9-g5e5ekytpmwt4p2s2whwo5n23uezvaau/lib'
--with-boot-ldflags='-Wl,-rpath,/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/lib
-Wl,-rpath,/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/lib64
-Wl,-rpath,/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/gmp-6.2.1-y5nxi6djabr65jjm4pquijfju46tioyl/lib
-Wl,-rpath,/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/mpfr-4.1.0-wkdcn7axxshpddf24rlmrgbnl4b5x4uj/lib
-Wl,-rpath,/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/mpc-1.1.0-v6jniwtyay66af7sk43c75njjrsoyjns/lib
-Wl,-rpath,/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/zlib-1.2.11-xfc275gqwmrd3cwbjnqbnqx2u5gz444l/lib
-Wl,-rpath,/home/enolan/spack/opt/spack/linux-ubuntu21.04-zen3/gcc-11.0.1/zstd-1.4.9-g5e5ekytpmwt4p2s2whwo5n23uezvaau/lib
-static-libstdc++ -static-libgcc'

> the complete command line that triggers the bug

g++ -v -save-temps -std=c++17 -c ./ice.cpp

> the compiler output (error messages, warnings, etc.)

./ice.cpp: In instantiation of 'struct
Qux<int>::AsyncOp()::<lambda(auto:1)>::local':
./ice.cpp:10:13:   required from 'Qux<int>::AsyncOp()::<lambda(auto:1)> [with
auto:1 = int]'
./ice.cpp:11:6:   required from 'void Qux< <template-parameter-1-1>
>::AsyncOp() [with <template-parameter-1-1> = int]'
./ice.cpp:17:14:   required from here
./ice.cpp:7:16: internal compiler error: in lookup_template_class_1, at
cp/pt.c:10005
    7 |     [this](auto) {
      |                ^
0x6e97ee lookup_template_class_1
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:10005
0xb00806 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:10244
0xb00806 tsubst_aggr_type
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:13609
0xaf455c tsubst(tree_node*, tree_node*, int, tree_node*)
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:15472
0xadfe1c tsubst_decl
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:14481
0xad5a41 tsubst_copy
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:16575
0xad7480 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:20766
0xad7c82 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:19648
0xad7ec2 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:20546
0xae2718 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:19123
0xae0ad6 tsubst_decl
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:14831
0xad645c tsubst_copy
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:16710
0xad7480 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:20766
0xad7c82 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:19648
0xad7ec2 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:20546
0xaf4d1e tsubst(tree_node*, tree_node*, int, tree_node*)
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:16126
0xb0d132 instantiate_class_template_1
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:11900
0xb0eab2 instantiate_class_template(tree_node*)
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:12282
0xb5b109 complete_type(tree_node*)
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/typeck.c:143
0xae0725 tsubst_decl
       
/tmp/enolan/spack-stage/spack-stage-gcc-11.1.0.58b735-lfokficgbii3qo3wxptqa6cpavixfdwb/spack-src/gcc/cp/pt.c:14817
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.

> the preprocessed file (*.i*) that triggers the bug, generated by adding -save-temps to
      the complete compilation command, or, in the case of a bug report for the
GNAT front
      end, a complete set of source files (see below).

# 0 "./ice.cpp"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "./ice.cpp"
template <class>
struct Qux {
  struct A { } a_;
  A f();

  void AsyncOp() {
    [this](auto) {
      using Foo = decltype(a_);
      struct local : Foo {};
      local ptr;
    }(0);
  }
};

void corge() {
  Qux<int> qux;
  qux.AsyncOp();
}

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/101303] ICE from modified lambda-generic-100362.C test case from bug 100362
  2021-07-02 18:07 [Bug c++/101303] New: ICE from modified lambda-generic-100362.C test case from bug 100362 enolan at alumni dot cmu.edu
@ 2021-07-02 18:27 ` enolan at alumni dot cmu.edu
  2021-07-07 19:12 ` [Bug c++/101303] [9/10/11/12 Regression] " ppalka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: enolan at alumni dot cmu.edu @ 2021-07-02 18:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Edward Nolan <enolan at alumni dot cmu.edu> ---
Some godbolt-ing shows that this test case is an ICE in GCC versions 9, 10, 11,
and 12, and rejects-valid in GCC 8.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/101303] [9/10/11/12 Regression] ICE from modified lambda-generic-100362.C test case from bug 100362
  2021-07-02 18:07 [Bug c++/101303] New: ICE from modified lambda-generic-100362.C test case from bug 100362 enolan at alumni dot cmu.edu
  2021-07-02 18:27 ` [Bug c++/101303] " enolan at alumni dot cmu.edu
@ 2021-07-07 19:12 ` ppalka at gcc dot gnu.org
  2022-01-17 14:06 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-07-07 19:12 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |9.5
            Summary|ICE from modified           |[9/10/11/12 Regression] ICE
                   |lambda-generic-100362.C     |from modified
                   |test case from bug 100362   |lambda-generic-100362.C
                   |                            |test case from bug 100362
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |ppalka at gcc dot gnu.org
   Last reconfirmed|                            |2021-07-07
      Known to fail|                            |10.3.0, 11.1.0, 9.4.0

--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Confirmed, started with r8-4571.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/101303] [9/10/11/12 Regression] ICE from modified lambda-generic-100362.C test case from bug 100362
  2021-07-02 18:07 [Bug c++/101303] New: ICE from modified lambda-generic-100362.C test case from bug 100362 enolan at alumni dot cmu.edu
  2021-07-02 18:27 ` [Bug c++/101303] " enolan at alumni dot cmu.edu
  2021-07-07 19:12 ` [Bug c++/101303] [9/10/11/12 Regression] " ppalka at gcc dot gnu.org
@ 2022-01-17 14:06 ` rguenth at gcc dot gnu.org
  2022-05-27  9:45 ` [Bug c++/101303] [10/11/12/13 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-17 14:06 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/101303] [10/11/12/13 Regression] ICE from modified lambda-generic-100362.C test case from bug 100362
  2021-07-02 18:07 [Bug c++/101303] New: ICE from modified lambda-generic-100362.C test case from bug 100362 enolan at alumni dot cmu.edu
                   ` (2 preceding siblings ...)
  2022-01-17 14:06 ` rguenth at gcc dot gnu.org
@ 2022-05-27  9:45 ` rguenth at gcc dot gnu.org
  2022-06-28 10:45 ` jakub at gcc dot gnu.org
  2023-07-07 10:40 ` [Bug c++/101303] [11/12/13/14 " rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:45 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |10.4

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/101303] [10/11/12/13 Regression] ICE from modified lambda-generic-100362.C test case from bug 100362
  2021-07-02 18:07 [Bug c++/101303] New: ICE from modified lambda-generic-100362.C test case from bug 100362 enolan at alumni dot cmu.edu
                   ` (3 preceding siblings ...)
  2022-05-27  9:45 ` [Bug c++/101303] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:45 ` jakub at gcc dot gnu.org
  2023-07-07 10:40 ` [Bug c++/101303] [11/12/13/14 " rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:45 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/101303] [11/12/13/14 Regression] ICE from modified lambda-generic-100362.C test case from bug 100362
  2021-07-02 18:07 [Bug c++/101303] New: ICE from modified lambda-generic-100362.C test case from bug 100362 enolan at alumni dot cmu.edu
                   ` (4 preceding siblings ...)
  2022-06-28 10:45 ` jakub at gcc dot gnu.org
@ 2023-07-07 10:40 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:40 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-07-07 10:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02 18:07 [Bug c++/101303] New: ICE from modified lambda-generic-100362.C test case from bug 100362 enolan at alumni dot cmu.edu
2021-07-02 18:27 ` [Bug c++/101303] " enolan at alumni dot cmu.edu
2021-07-07 19:12 ` [Bug c++/101303] [9/10/11/12 Regression] " ppalka at gcc dot gnu.org
2022-01-17 14:06 ` rguenth at gcc dot gnu.org
2022-05-27  9:45 ` [Bug c++/101303] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:45 ` jakub at gcc dot gnu.org
2023-07-07 10:40 ` [Bug c++/101303] [11/12/13/14 " rguenth at gcc dot gnu.org

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).