public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bobmiller at nvidia dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/100279] Invalid generated assembly for NTTP lambda with negative double value
Date: Tue, 27 Apr 2021 05:01:45 +0000	[thread overview]
Message-ID: <bug-100279-4-4Gnys8A5nN@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100279-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Bob Miller <bobmiller at nvidia dot com> ---
In further minifying this example, I've discovered a related ICE. The ICE can
be seen on godbolt here: https://godbolt.org/z/vxzG1zMjo

I've attached a new preprocessed file that triggers the ICE. Code is as
follows:

template<auto V> struct T {};

template<auto X>
void f(T<X>) {}

template<auto V, auto V2>
void E()
{
    f(T<V>{});
    f(T<V2>{});
}

void foo()
{
    E<-1.0, -2.0>();
}

int main(int, char**) {return 0;}

New example's error output:

Using built-in specs.
COLLECT_GCC=/opt/compiler-explorer/gcc-snapshot/bin/g++
Target: x86_64-linux-gnu
Configured with: ../gcc-trunk-20210426/configure
--prefix=/opt/compiler-explorer/gcc-build/staging --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu --disable-bootstrap
--enable-multiarch --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --enable-clocale=gnu --enable-languages=c,c++,fortran,ada,d
--enable-ld=yes --enable-gold=yes --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-linker-build-id --enable-lto
--enable-plugins --enable-threads=posix
--with-pkgversion=Compiler-Explorer-Build
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210425 (experimental) (Compiler-Explorer-Build) 
COLLECT_GCC_OPTIONS='-fdiagnostics-color=always' '-g' '-o' '/app/output.s'
'-masm=intel' '-S' '-std=c++20' '-v' '-save-temps' '-Wall' '-Wextra'
'-fno-strict-aliasing' '-fwrapv' '-fno-aggressive-loop-optimizations'
'-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' '/app/'

/opt/compiler-explorer/gcc-trunk-20210426/bin/../libexec/gcc/x86_64-linux-gnu/12.0.0/cc1plus
-E -quiet -v -imultiarch x86_64-linux-gnu -iprefix
/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/x86_64-linux-gnu/12.0.0/
-D_GNU_SOURCE <source> -masm=intel -mtune=generic -march=x86-64 -std=c++20
-Wall -Wextra -fdiagnostics-color=always -fno-strict-aliasing -fwrapv
-fno-aggressive-loop-optimizations -g -fworking-directory -fpch-preprocess -o
/app/output.ii
ignoring nonexistent directory
"/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../x86_64-linux-gnu/include"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/x86_64-linux-gnu"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/backward"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/12.0.0/include"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/12.0.0/include-fixed"
ignoring nonexistent directory
"/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0

/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/x86_64-linux-gnu

/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/backward

/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/x86_64-linux-gnu/12.0.0/include

/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/x86_64-linux-gnu/12.0.0/include-fixed
 /usr/local/include
 /opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/../../include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-fdiagnostics-color=always' '-g' '-o' '/app/output.s'
'-masm=intel' '-S' '-std=c++20' '-v' '-save-temps' '-Wall' '-Wextra'
'-fno-strict-aliasing' '-fwrapv' '-fno-aggressive-loop-optimizations'
'-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' '/app/'

/opt/compiler-explorer/gcc-trunk-20210426/bin/../libexec/gcc/x86_64-linux-gnu/12.0.0/cc1plus
-fpreprocessed /app/output.ii -quiet -dumpdir /app/ -dumpbase output.cpp
-dumpbase-ext .cpp -masm=intel -mtune=generic -march=x86-64 -g -Wall -Wextra
-std=c++20 -version -fdiagnostics-color=always -fno-strict-aliasing -fwrapv
-fno-aggressive-loop-optimizations -o /app/output.s
GNU C++20 (Compiler-Explorer-Build) version 12.0.0 20210425 (experimental)
(x86_64-linux-gnu)
        compiled by GNU C version 7.5.0, GMP version 6.1.0, MPFR version 3.1.4,
MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++20 (Compiler-Explorer-Build) version 12.0.0 20210425 (experimental)
(x86_64-linux-gnu)
        compiled by GNU C version 7.5.0, GMP version 6.1.0, MPFR version 3.1.4,
MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: d98c31982476edc90c9c0027eb63ad59
<source>:18:33: error: Two symbols with same comdat_group are not linked by the
same_comdat_group list.
   18 | int main(int, char**) {return 0;}
      |                                 ^
_Z1fILdffffffff00000000EEv1TIXT_EE/4 (void f(T<X>) [with auto X = -2.0e+0])
@0x7fb785007660
  Type: function definition analyzed
  Visibility: no_reorder public weak comdat
comdat_group:_Z1fILdffffffff00000000EEv1TIXT_EE one_only
  previous sharing asm name: 3
  References: 
  Referring: 
  Function flags: body
  Called by: _Z1EILdffffffff00000000ELdffffffff00000000EEvv/2 
  Calls: 
_Z1fILdffffffff00000000EEv1TIXT_EE/3 (void f(T<X>) [with auto X = -1.0e+0])
@0x7fb785007550
  Type: function definition analyzed
  Visibility: no_reorder public weak comdat
comdat_group:_Z1fILdffffffff00000000EEv1TIXT_EE one_only
  next sharing asm name: 4
  References: 
  Referring: 
  Function flags: body
  Called by: _Z1EILdffffffff00000000ELdffffffff00000000EEvv/2 
  Calls: 
<source>:18:33: internal compiler error: symtab_node::verify failed
0x1cfe7f9 internal_error(char const*, ...)
        ???:0
0xb37622 symtab_node::verify_symtab_nodes()
        ???:0
0xb5398f symbol_table::finalize_compilation_unit()
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
ASM generation compiler returned: 1
Using built-in specs.
COLLECT_GCC=/opt/compiler-explorer/gcc-snapshot/bin/g++
COLLECT_LTO_WRAPPER=/opt/compiler-explorer/gcc-trunk-20210426/bin/../libexec/gcc/x86_64-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../gcc-trunk-20210426/configure
--prefix=/opt/compiler-explorer/gcc-build/staging --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu --disable-bootstrap
--enable-multiarch --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --enable-clocale=gnu --enable-languages=c,c++,fortran,ada,d
--enable-ld=yes --enable-gold=yes --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-linker-build-id --enable-lto
--enable-plugins --enable-threads=posix
--with-pkgversion=Compiler-Explorer-Build
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210425 (experimental) (Compiler-Explorer-Build) 
COLLECT_GCC_OPTIONS='-fdiagnostics-color=always' '-g' '-o' '/app/output.s'
'-L.' '-std=c++20' '-v' '-save-temps' '-Wall' '-Wextra' '-fno-strict-aliasing'
'-fwrapv' '-fno-aggressive-loop-optimizations' '-shared-libgcc'
'-mtune=generic' '-march=x86-64' '-dumpdir' '/app/output.s-'

/opt/compiler-explorer/gcc-trunk-20210426/bin/../libexec/gcc/x86_64-linux-gnu/12.0.0/cc1plus
-E -quiet -v -imultiarch x86_64-linux-gnu -iprefix
/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/x86_64-linux-gnu/12.0.0/
-D_GNU_SOURCE <source> -mtune=generic -march=x86-64 -std=c++20 -Wall -Wextra
-fdiagnostics-color=always -fno-strict-aliasing -fwrapv
-fno-aggressive-loop-optimizations -g -fworking-directory -fpch-preprocess -o
/app/output.s-example.ii
ignoring nonexistent directory
"/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../x86_64-linux-gnu/include"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/x86_64-linux-gnu"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/backward"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/12.0.0/include"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring duplicate directory
"/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/12.0.0/include-fixed"
ignoring nonexistent directory
"/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/../../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0

/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/x86_64-linux-gnu

/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/backward

/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/x86_64-linux-gnu/12.0.0/include

/opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/x86_64-linux-gnu/12.0.0/include-fixed
 /usr/local/include
 /opt/compiler-explorer/gcc-trunk-20210426/bin/../lib/gcc/../../include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-fdiagnostics-color=always' '-g' '-o' '/app/output.s'
'-L.' '-std=c++20' '-v' '-save-temps' '-Wall' '-Wextra' '-fno-strict-aliasing'
'-fwrapv' '-fno-aggressive-loop-optimizations' '-shared-libgcc'
'-mtune=generic' '-march=x86-64' '-dumpdir' '/app/output.s-'

/opt/compiler-explorer/gcc-trunk-20210426/bin/../libexec/gcc/x86_64-linux-gnu/12.0.0/cc1plus
-fpreprocessed /app/output.s-example.ii -quiet -dumpdir /app/output.s-
-dumpbase example.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -g -Wall
-Wextra -std=c++20 -version -fdiagnostics-color=always -fno-strict-aliasing
-fwrapv -fno-aggressive-loop-optimizations -o /app/output.s-example.s
GNU C++20 (Compiler-Explorer-Build) version 12.0.0 20210425 (experimental)
(x86_64-linux-gnu)
        compiled by GNU C version 7.5.0, GMP version 6.1.0, MPFR version 3.1.4,
MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++20 (Compiler-Explorer-Build) version 12.0.0 20210425 (experimental)
(x86_64-linux-gnu)
        compiled by GNU C version 7.5.0, GMP version 6.1.0, MPFR version 3.1.4,
MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: d98c31982476edc90c9c0027eb63ad59
<source>:18:33: error: Two symbols with same comdat_group are not linked by the
same_comdat_group list.
   18 | int main(int, char**) {return 0;}
      |                                 ^
_Z1fILdffffffff00000000EEv1TIXT_EE/4 (void f(T<X>) [with auto X = -2.0e+0])
@0x7f202ca39660
  Type: function definition analyzed
  Visibility: no_reorder public weak comdat
comdat_group:_Z1fILdffffffff00000000EEv1TIXT_EE one_only
  previous sharing asm name: 3
  References: 
  Referring: 
  Function flags: body
  Called by: _Z1EILdffffffff00000000ELdffffffff00000000EEvv/2 
  Calls: 
_Z1fILdffffffff00000000EEv1TIXT_EE/3 (void f(T<X>) [with auto X = -1.0e+0])
@0x7f202ca39550
  Type: function definition analyzed
  Visibility: no_reorder public weak comdat
comdat_group:_Z1fILdffffffff00000000EEv1TIXT_EE one_only
  next sharing asm name: 4
  References: 
  Referring: 
  Function flags: body
  Called by: _Z1EILdffffffff00000000ELdffffffff00000000EEvv/2 
  Calls: 
<source>:18:33: internal compiler error: symtab_node::verify failed
0x1cfe7f9 internal_error(char const*, ...)
        ???:0
0xb37622 symtab_node::verify_symtab_nodes()
        ???:0
0xb5398f symbol_table::finalize_compilation_unit()
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Execution build compiler returned: 1

  parent reply	other threads:[~2021-04-27  5:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27  1:33 [Bug c++/100279] New: " bobmiller at nvidia dot com
2021-04-27  4:58 ` [Bug c++/100279] " bobmiller at nvidia dot com
2021-04-27  5:01 ` bobmiller at nvidia dot com [this message]
2021-04-27  5:22 ` [Bug c++/100279] [ICE in trunk] ICE caused by negative double NTTP. Error: Two symbols with same comdat_group are not linked by the same_comdat_group list bobmiller at nvidia dot com
2021-04-27 18:42 ` ppalka at gcc dot gnu.org
2021-07-27  8:08 ` 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-100279-4-4Gnys8A5nN@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).