public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99118] New: ICE in alias_ctad_tweaks, at cp/pt.c:28569
@ 2021-02-16 13:11 wang_feng at live dot com
  2021-02-16 15:58 ` [Bug c++/99118] " marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: wang_feng at live dot com @ 2021-02-16 13:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99118
           Summary: ICE in alias_ctad_tweaks, at cp/pt.c:28569
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wang_feng at live dot com
  Target Milestone: ---

Created attachment 50198
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50198&action=edit
reproducible code

ICE when compiling heavily templated code of c++20.

command to reproduce:

/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/cc1plus -fpreprocessed keras_model_2.ii
-march=skylake -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16
-msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4
-mno-xop -mbmi -msgx -mbmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mavx -mavx2
-msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mrdseed
-mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er
-mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves
-mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi
-mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mno-mwaitx -mno-clzero -mno-pku
-mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes
-mno-vpclmulqdq -mno-avx512bitalg -mno-avx512vpopcntdq -mno-movdiri
-mno-movdir64b -mno-waitpkg -mno-cldemote -mno-ptwrite -mno-avx512bf16
-mno-enqcmd -mno-avx512vp2intersect --param l1-cache-size=32 --param
l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=skylake -quiet
-dumpbase keras_model.cc -auxbase-strip ./obj/test_keras_model.o -Ofast -Wall
-Wextra -std=c++2a -version -fmax-errors=1 -ftemplate-backtrace-limit=0
-funsafe-math-optimizations -flto -o keras_model.s

error message:

keras_model_2.ii: In function ‘int main()’:
keras_model_2.ii:102634:40: internal compiler error: in alias_ctad_tweaks, at
cp/pt.c:28569
102634 |     auto model = Model{ input, layer_4 };
       |                                        ^



g++ version given by 'gcc -v':

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl
--with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit
--enable-cet=auto --enable-checking=release --enable-clocale=gnu
--enable-default-pie --enable-default-ssp --enable-gnu-indirect-function
--enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id
--enable-lto --enable-multilib --enable-plugin --enable-shared
--enable-threads=posix --disable-libssp --disable-libstdcxx-pch
--disable-libunwind-exceptions --disable-werror
gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (GCC) 

system:

Archlinux 5.4.98-1-lts

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

* [Bug c++/99118] ICE in alias_ctad_tweaks, at cp/pt.c:28569
  2021-02-16 13:11 [Bug c++/99118] New: ICE in alias_ctad_tweaks, at cp/pt.c:28569 wang_feng at live dot com
@ 2021-02-16 15:58 ` marxin at gcc dot gnu.org
  2021-02-16 16:02 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-02-16 15:58 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-02-16
                 CC|                            |marxin at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, thank you for the report.
I'm reducing that right now.

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

* [Bug c++/99118] ICE in alias_ctad_tweaks, at cp/pt.c:28569
  2021-02-16 13:11 [Bug c++/99118] New: ICE in alias_ctad_tweaks, at cp/pt.c:28569 wang_feng at live dot com
  2021-02-16 15:58 ` [Bug c++/99118] " marxin at gcc dot gnu.org
@ 2021-02-16 16:02 ` mpolacek at gcc dot gnu.org
  2021-02-16 16:11 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-02-16 16:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Must be a dup of one of PR93085 / PR93295 / PR96873.

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

* [Bug c++/99118] ICE in alias_ctad_tweaks, at cp/pt.c:28569
  2021-02-16 13:11 [Bug c++/99118] New: ICE in alias_ctad_tweaks, at cp/pt.c:28569 wang_feng at live dot com
  2021-02-16 15:58 ` [Bug c++/99118] " marxin at gcc dot gnu.org
  2021-02-16 16:02 ` mpolacek at gcc dot gnu.org
@ 2021-02-16 16:11 ` marxin at gcc dot gnu.org
  2021-02-16 16:12 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-02-16 16:11 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
           Assignee|marxin at gcc dot gnu.org          |unassigned at gcc dot gnu.org

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Reduced test-case:

template <typename> struct Dense_Config;
template <typename... Args> using Dense = Dense_Config<Args...>;
auto layer_1 = Dense {}

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

* [Bug c++/99118] ICE in alias_ctad_tweaks, at cp/pt.c:28569
  2021-02-16 13:11 [Bug c++/99118] New: ICE in alias_ctad_tweaks, at cp/pt.c:28569 wang_feng at live dot com
                   ` (2 preceding siblings ...)
  2021-02-16 16:11 ` marxin at gcc dot gnu.org
@ 2021-02-16 16:12 ` marxin at gcc dot gnu.org
  2021-04-10  4:07 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-02-16 16:12 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Likely started with r10-5020-g1a291106384cabc7.

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

* [Bug c++/99118] ICE in alias_ctad_tweaks, at cp/pt.c:28569
  2021-02-16 13:11 [Bug c++/99118] New: ICE in alias_ctad_tweaks, at cp/pt.c:28569 wang_feng at live dot com
                   ` (3 preceding siblings ...)
  2021-02-16 16:12 ` marxin at gcc dot gnu.org
@ 2021-04-10  4:07 ` cvs-commit at gcc dot gnu.org
  2021-04-10  4:13 ` jason at gcc dot gnu.org
  2021-05-20 21:35 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-10  4:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:1a19d334ce493ec2ce2daeac74beef63fd67e2bc

commit r11-8104-g1a19d334ce493ec2ce2daeac74beef63fd67e2bc
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Apr 9 18:02:38 2021 -0400

    c++: deduction guide using alias [PR99180]

    alias_ctad_tweaks was expecting that all deduction guides for the class
    would be suitable for deduction from the alias definition; in this case,
the
    deduction guide uses 'true' and the alias B uses 'false', so deduction
    fails.  But that's OK, we just don't use that deduction guide.  I also
    noticed that we were giving up on deduction entirely if substitution failed
    for some guide; we should only give up on that particular deduction guide.

    We ought to give a better diagnostic about this case when deduction fails,
    but that can wait.

    gcc/cp/ChangeLog:

            PR c++/99180
            PR c++/93295
            PR c++/93867
            PR c++/99118
            PR c++/96873
            * pt.c (alias_ctad_tweaks): Handle failure better.

    gcc/testsuite/ChangeLog:

            PR c++/99180
            PR c++/93295
            PR c++/93867
            PR c++/95486
            * g++.dg/cpp2a/class-deduction-alias5.C: New test.
            * g++.dg/cpp2a/class-deduction-alias6.C: New test.
            * g++.dg/cpp2a/class-deduction-alias7.C: New test.
            * g++.dg/cpp2a/class-deduction-alias8.C: New test.

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

* [Bug c++/99118] ICE in alias_ctad_tweaks, at cp/pt.c:28569
  2021-02-16 13:11 [Bug c++/99118] New: ICE in alias_ctad_tweaks, at cp/pt.c:28569 wang_feng at live dot com
                   ` (4 preceding siblings ...)
  2021-04-10  4:07 ` cvs-commit at gcc dot gnu.org
@ 2021-04-10  4:13 ` jason at gcc dot gnu.org
  2021-05-20 21:35 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2021-04-10  4:13 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Dup.

*** This bug has been marked as a duplicate of bug 93295 ***

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

* [Bug c++/99118] ICE in alias_ctad_tweaks, at cp/pt.c:28569
  2021-02-16 13:11 [Bug c++/99118] New: ICE in alias_ctad_tweaks, at cp/pt.c:28569 wang_feng at live dot com
                   ` (5 preceding siblings ...)
  2021-04-10  4:13 ` jason at gcc dot gnu.org
@ 2021-05-20 21:35 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-05-20 21:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:92e9b2a995f718f1c2ab1cd0840b439c24d3535f

commit r10-9852-g92e9b2a995f718f1c2ab1cd0840b439c24d3535f
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Apr 9 18:02:38 2021 -0400

    c++: deduction guide using alias [PR99180]

    alias_ctad_tweaks was expecting that all deduction guides for the class
    would be suitable for deduction from the alias definition; in this case,
the
    deduction guide uses 'true' and the alias B uses 'false', so deduction
    fails.  But that's OK, we just don't use that deduction guide.  I also
    noticed that we were giving up on deduction entirely if substitution failed
    for some guide; we should only give up on that particular deduction guide.

    We ought to give a better diagnostic about this case when deduction fails,
    but that can wait.

    gcc/cp/ChangeLog:

            PR c++/99180
            PR c++/93295
            PR c++/93867
            PR c++/99118
            PR c++/96873
            * pt.c (alias_ctad_tweaks): Handle failure better.

    gcc/testsuite/ChangeLog:

            PR c++/99180
            PR c++/93295
            PR c++/93867
            PR c++/95486
            * g++.dg/cpp2a/class-deduction-alias5.C: New test.
            * g++.dg/cpp2a/class-deduction-alias6.C: New test.
            * g++.dg/cpp2a/class-deduction-alias7.C: New test.
            * g++.dg/cpp2a/class-deduction-alias8.C: New test.

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

end of thread, other threads:[~2021-05-20 21:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 13:11 [Bug c++/99118] New: ICE in alias_ctad_tweaks, at cp/pt.c:28569 wang_feng at live dot com
2021-02-16 15:58 ` [Bug c++/99118] " marxin at gcc dot gnu.org
2021-02-16 16:02 ` mpolacek at gcc dot gnu.org
2021-02-16 16:11 ` marxin at gcc dot gnu.org
2021-02-16 16:12 ` marxin at gcc dot gnu.org
2021-04-10  4:07 ` cvs-commit at gcc dot gnu.org
2021-04-10  4:13 ` jason at gcc dot gnu.org
2021-05-20 21:35 ` cvs-commit 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).