public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/115657] New: [15 regression] ICE in tsubst_enum/tsubst_expr during template instantiation
@ 2024-06-26  4:04 vopl at bk dot ru
  2024-06-26  4:20 ` [Bug c++/115657] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vopl at bk dot ru @ 2024-06-26  4:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115657
           Summary: [15 regression] ICE in tsubst_enum/tsubst_expr during
                    template instantiation
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vopl at bk dot ru
  Target Milestone: ---

$ cat ./ice-15.cpp && echo EOFFFFFFFFFF
struct NonIntegral
{
    constexpr operator int() { return 0; }
};

template<typename T> struct TemplatedStructural
{
    enum { e = NonIntegral{} };
};

template struct TemplatedStructural<void>;
EOFFFFFFFFFF

$ g++-15 -v -c ./ice-15.cpp
Using built-in specs.
COLLECT_GCC=g++-15
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/15
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/15/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/15/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/15/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --disable-nls
--disable-libunwind-exceptions --enable-checking=yes,extra
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 15.0.9999 p,
commit 772589fa2b38f09c2f62743d906e12875492d9e0' --with-gcc-major-version-only
--enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point
--enable-targets=all --enable-libgomp --disable-libssp --disable-libada
--enable-cet --enable-systemtap --disable-valgrind-annotations
--enable-vtable-verify --with-zstd --with-isl --disable-isl-version-check
--enable-default-pie --enable-host-pie --enable-host-bind-now
--disable-default-ssp --disable-fixincludes --with-build-config='bootstrap-lto
bootstrap-cet'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240610 (experimental)
eb316013a7c841094577a57407f605b5a7ca5eee (Gentoo 15.0.9999 p, commit
772589fa2b38f09c2f62743d906e12875492d9e0) 
COLLECT_GCC_OPTIONS='-v' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/15/cc1plus -quiet -v -D_GNU_SOURCE
./ice-15.cpp -quiet -dumpbase ice-15.cpp -dumpbase-ext .cpp -mtune=generic
-march=x86-64 -version -fcf-protection -o /tmp/cchq8U8U.s
GNU C++17 (Gentoo 15.0.9999 p, commit 772589fa2b38f09c2f62743d906e12875492d9e0)
version 15.0.0 20240610 (experimental) eb316013a7c841094577a57407f605b5a7ca5eee
(x86_64-pc-linux-gnu)
        compiled by GNU C version 15.0.0 20240610 (experimental)
eb316013a7c841094577a57407f605b5a7ca5eee, GMP version 6.3.0, MPFR version
4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-pc-linux-gnu/15/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15
 /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/x86_64-pc-linux-gnu
 /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/backward
 /usr/lib/gcc/x86_64-pc-linux-gnu/15/include
 /usr/include
End of search list.
Compiler executable checksum: c29e8810e60ad9d4d5598df79d33bb1a
./ice-15.cpp: In instantiation of 'struct TemplatedStructural<void>':
./ice-15.cpp:11:17:   required from here
   11 | template struct TemplatedStructural<void>;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
./ice-15.cpp:8:10: internal compiler error: in tsubst_expr, at cp/pt.cc:21872
    8 |     enum { e = NonIntegral{} };
      |          ^
0x5605c612fdac tsubst_expr(tree_node*, tree_node*, int, tree_node*)
        /usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/cp/pt.cc:21872
0x5605c725d18c tsubst_enum
        /usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/cp/pt.cc:27727
0x5605c725d18c lookup_template_class(tree_node*, tree_node*, tree_node*,
tree_node*, int)
        /usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/cp/pt.cc:10498
0x5605c7265a9b tsubst(tree_node*, tree_node*, int, tree_node*)
        /usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/cp/pt.cc:16267
0x5605c733badf tsubst_decl
        /usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/cp/pt.cc:15437
0x5605c738a042 instantiate_class_template(tree_node*)
        /usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/cp/pt.cc:12574
0x5605c6fc5348 complete_type(tree_node*)
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/cp/typeck.cc:138
0x5605c77c2dff do_type_instantiation(tree_node*, tree_node*, int)
        /usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/cp/pt.cc:26548
0x5605c77c2235 cp_parser_explicit_instantiation
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/cp/parser.cc:19997
0x5605c7070221 cp_parser_declaration
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/cp/parser.cc:15681
0x5605c7698201 cp_parser_toplevel_declaration
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/cp/parser.cc:15736
0x5605c7698201 cp_parser_translation_unit
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/cp/parser.cc:5299
0x5605c7698201 c_parse_file()
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/cp/parser.cc:51902
0x5605c766d522 c_common_parse_file()
       
/usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/gcc/c-family/c-opts.cc:1311
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.

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

* [Bug c++/115657] ICE in tsubst_enum/tsubst_expr during template instantiation
  2024-06-26  4:04 [Bug c++/115657] New: [15 regression] ICE in tsubst_enum/tsubst_expr during template instantiation vopl at bk dot ru
@ 2024-06-26  4:20 ` pinskia at gcc dot gnu.org
  2024-06-26  4:23 ` [Bug c++/115657] [12/13/14/15 Regression] " pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-26  4:20 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |12.1.0, 13.1.0, 14.1.0,
                   |                            |15.0
           Keywords|                            |ice-checking
            Summary|[15 regression] ICE in      |ICE in
                   |tsubst_enum/tsubst_expr     |tsubst_enum/tsubst_expr
                   |during template             |during template
                   |instantiation               |instantiation

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
      /* We shouldn't get here, but keep going if !flag_checking.  */
      if (flag_checking)
        gcc_unreachable ();


And yes it ICEs with -fchecking starting with GCC 12. I have not checked if
this changed to the above check in GCC 12 though.

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

* [Bug c++/115657] [12/13/14/15 Regression] ICE in tsubst_enum/tsubst_expr during template instantiation
  2024-06-26  4:04 [Bug c++/115657] New: [15 regression] ICE in tsubst_enum/tsubst_expr during template instantiation vopl at bk dot ru
  2024-06-26  4:20 ` [Bug c++/115657] " pinskia at gcc dot gnu.org
@ 2024-06-26  4:23 ` pinskia at gcc dot gnu.org
  2024-06-26 14:05 ` mpolacek at gcc dot gnu.org
  2024-06-26 14:09 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-26  4:23 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-06-26
   Target Milestone|---                         |12.5
            Summary|ICE in                      |[12/13/14/15 Regression]
                   |tsubst_enum/tsubst_expr     |ICE in
                   |during template             |tsubst_enum/tsubst_expr
                   |instantiation               |during template
                   |                            |instantiation
      Known to work|                            |11.1.0
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So confirmed.

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

* [Bug c++/115657] [12/13/14/15 Regression] ICE in tsubst_enum/tsubst_expr during template instantiation
  2024-06-26  4:04 [Bug c++/115657] New: [15 regression] ICE in tsubst_enum/tsubst_expr during template instantiation vopl at bk dot ru
  2024-06-26  4:20 ` [Bug c++/115657] " pinskia at gcc dot gnu.org
  2024-06-26  4:23 ` [Bug c++/115657] [12/13/14/15 Regression] " pinskia at gcc dot gnu.org
@ 2024-06-26 14:05 ` mpolacek at gcc dot gnu.org
  2024-06-26 14:09 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-06-26 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r12-6821:

commit 053bcc97f4a59e3f2811b8a1edf60fd733a580a0
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Jan 20 05:45:02 2022 -0500

    c++: constexpr and -fno-elide-constructors [PR101072]

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

* [Bug c++/115657] [12/13/14/15 Regression] ICE in tsubst_enum/tsubst_expr during template instantiation
  2024-06-26  4:04 [Bug c++/115657] New: [15 regression] ICE in tsubst_enum/tsubst_expr during template instantiation vopl at bk dot ru
                   ` (2 preceding siblings ...)
  2024-06-26 14:05 ` mpolacek at gcc dot gnu.org
@ 2024-06-26 14:09 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-06-26 14:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
tsubst_expr gets TARGET_EXPR <D.2813, {}>.  We should probably have created an
IMPLICIT_CONV_EXPR for it.

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

end of thread, other threads:[~2024-06-26 14:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-26  4:04 [Bug c++/115657] New: [15 regression] ICE in tsubst_enum/tsubst_expr during template instantiation vopl at bk dot ru
2024-06-26  4:20 ` [Bug c++/115657] " pinskia at gcc dot gnu.org
2024-06-26  4:23 ` [Bug c++/115657] [12/13/14/15 Regression] " pinskia at gcc dot gnu.org
2024-06-26 14:05 ` mpolacek at gcc dot gnu.org
2024-06-26 14:09 ` mpolacek 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).