public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/115232] New: [14 regression] ICE during GIMPLE pass
@ 2024-05-26 11:45 vopl at bk dot ru
  2024-05-26 12:00 ` [Bug c++/115232] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: vopl at bk dot ru @ 2024-05-26 11:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115232
           Summary: [14 regression] ICE during GIMPLE pass
           Product: gcc
           Version: 14.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vopl at bk dot ru
  Target Milestone: ---

$ cat ./ice-14.cpp && echo EOFFFFF
// g++-14 -std=c++20 -v -c ./ice-14.cpp

/////////0/////////1/////////2/////////3/////////4/////////5/////////6/////////7
template<class T>
struct Outer
{
    Outer();

    template <class U>
    static constexpr bool staticTemplatedConstant = true;

    template <class U> void method() requires staticTemplatedConstant<U>
    {
        struct Inner
        {
            static void* operator new(unsigned long /*sz*/) {return new char;}
            static void operator delete(void*) {}

            Outer<void> _outerInstance;

        };

        new Inner;
    }

};

/////////0/////////1/////////2/////////3/////////4/////////5/////////6/////////7
void f()
{
    Outer<void>{}.method<void>();
}
EOFFFFF

$ g++-14 -std=c++20 -v -c ./ice-14.cpp
Using built-in specs.
COLLECT_GCC=g++-14
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-14.1.1_p20240518/work/gcc-14-20240518/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/14
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/14/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/14/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --disable-nls
--disable-libunwind-exceptions --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo
14.1.1_p20240518 p1' --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 14.1.1 20240516 (Gentoo 14.1.1_p20240518 p1) 
COLLECT_GCC_OPTIONS='-std=c++20' '-v' '-c' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/14/cc1plus -quiet -v -D_GNU_SOURCE
./ice-14.cpp -quiet -dumpbase ice-14.cpp -dumpbase-ext .cpp -mtune=generic
-march=x86-64 -std=c++20 -version -fcf-protection -o /tmp/cc0hiSMi.s
GNU C++20 (Gentoo 14.1.1_p20240518 p1) version 14.1.1 20240516
(x86_64-pc-linux-gnu)
        compiled by GNU C version 14.1.1 20240516, 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=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-pc-linux-gnu/14/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14
 /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/x86_64-pc-linux-gnu
 /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/backward
 /usr/lib/gcc/x86_64-pc-linux-gnu/14/include
 /usr/include
End of search list.
Compiler executable checksum: b63801264392b36e05179a0f762d8604
during GIMPLE pass: waccess
./ice-14.cpp: In member function 'void Outer<T>::method() requires 
staticTemplatedConstant<U> [with U = void; T = void]':
./ice-14.cpp:12:29: internal compiler error: Segmentation fault
   12 |     template <class U> void method() requires
staticTemplatedConstant<U>
      |                             ^~~~~~
0x55af8dca912c crash_signal
       
/usr/src/debug/sys-devel/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/toplev.cc:319
0x55af8dbea562 new_delete_mismatch_p
       
/usr/src/debug/sys-devel/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/gimple-ssa-warn-access.cc:1627
0x55af8d7e15d5 new_delete_mismatch_p
       
/usr/src/debug/sys-devel/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/gimple-ssa-warn-access.cc:1765
0x55af8d7e15d5 matching_alloc_calls_p
       
/usr/src/debug/sys-devel/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/gimple-ssa-warn-access.cc:1788
0x55af8e48fcdb matching_alloc_calls_p
       
/usr/src/debug/sys-devel/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/gimple-ssa-warn-access.cc:1998
0x55af8e48fcdb maybe_check_dealloc_call
       
/usr/src/debug/sys-devel/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/gimple-ssa-warn-access.cc:3757
0x55af8e48fcdb check_call
       
/usr/src/debug/sys-devel/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/gimple-ssa-warn-access.cc:4367
0x55af8e48fcdb check_block
       
/usr/src/debug/sys-devel/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/gimple-ssa-warn-access.cc:4444
0x55af8e48fcdb execute
       
/usr/src/debug/sys-devel/gcc-14.1.1_p20240518/gcc-14-20240518/gcc/gimple-ssa-warn-access.cc:4779
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] 9+ messages in thread

* [Bug c++/115232] [14 regression] ICE during GIMPLE pass
  2024-05-26 11:45 [Bug c++/115232] New: [14 regression] ICE during GIMPLE pass vopl at bk dot ru
@ 2024-05-26 12:00 ` pinskia at gcc dot gnu.org
  2024-05-26 12:00 ` [Bug tree-optimization/115232] [14/15 regression] ICE during GIMPLE pass during waccess pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-26 12:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 58292
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58292&action=edit
Slightly reduced

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

* [Bug tree-optimization/115232] [14/15 regression] ICE during GIMPLE pass during waccess
  2024-05-26 11:45 [Bug c++/115232] New: [14 regression] ICE during GIMPLE pass vopl at bk dot ru
  2024-05-26 12:00 ` [Bug c++/115232] " pinskia at gcc dot gnu.org
@ 2024-05-26 12:00 ` pinskia at gcc dot gnu.org
  2024-05-26 12:01 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-26 12:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.2
           Keywords|                            |ice-on-valid-code
            Summary|[14 regression] ICE during  |[14/15 regression] ICE
                   |GIMPLE pass                 |during GIMPLE pass during
                   |                            |waccess
          Component|c++                         |tree-optimization

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

* [Bug tree-optimization/115232] [14/15 regression] ICE during GIMPLE pass during waccess
  2024-05-26 11:45 [Bug c++/115232] New: [14 regression] ICE during GIMPLE pass vopl at bk dot ru
  2024-05-26 12:00 ` [Bug c++/115232] " pinskia at gcc dot gnu.org
  2024-05-26 12:00 ` [Bug tree-optimization/115232] [14/15 regression] ICE during GIMPLE pass during waccess pinskia at gcc dot gnu.org
@ 2024-05-26 12:01 ` pinskia at gcc dot gnu.org
  2024-05-27  7:10 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-26 12:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-05-26
             Status|UNCONFIRMED                 |NEW

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

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

* [Bug tree-optimization/115232] [14/15 regression] ICE during GIMPLE pass during waccess
  2024-05-26 11:45 [Bug c++/115232] New: [14 regression] ICE during GIMPLE pass vopl at bk dot ru
                   ` (2 preceding siblings ...)
  2024-05-26 12:01 ` pinskia at gcc dot gnu.org
@ 2024-05-27  7:10 ` rguenth at gcc dot gnu.org
  2024-05-27  9:24 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-27  7:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
(gdb) p newc
$1 = (const demangle_component &) <error reading variable: Cannot access memory
at address 0x0>
(gdb) p delc
$2 = (const demangle_component &) <error reading variable: Cannot access memory
at address 0x0>

1763      demangle_component *ndc = cplus_demangle_v3_components (new_str, 0,
&np);
1764      demangle_component *ddc = cplus_demangle_v3_components (del_str, 0,
&dp);
1765      bool mismatch = new_delete_mismatch_p (*ndc, *ddc);

(gdb) p new_str
$3 = 0x7ffff7009ea8 "_ZZN5OuterIvE6methodIvEEvvQ3cstITL0__EEN5InnernwEm"
(gdb) p del_str
$4 = 0x7ffff7009e70 "_ZZN5OuterIvE6methodIvEEvvQ3cstITL0__EEN5InnerdlEPv"

so we cannot demangle these?  But we expect no failure.  It should be trivial
to build in safety here, mine for that.  I'll keep the PR open for the
failed demangle though.

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

* [Bug tree-optimization/115232] [14/15 regression] ICE during GIMPLE pass during waccess
  2024-05-26 11:45 [Bug c++/115232] New: [14 regression] ICE during GIMPLE pass vopl at bk dot ru
                   ` (3 preceding siblings ...)
  2024-05-27  7:10 ` rguenth at gcc dot gnu.org
@ 2024-05-27  9:24 ` cvs-commit at gcc dot gnu.org
  2024-05-27  9:25 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-27  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:311d7f5c17b8969c7ed8e4f23178d6ec4752e33f

commit r15-848-g311d7f5c17b8969c7ed8e4f23178d6ec4752e33f
Author: Richard Biener <rguenther@suse.de>
Date:   Mon May 27 09:13:11 2024 +0200

    tree-optimization/115232 - demangle failure during -Waccess

    For the following testcase we fail to demangle
    _ZZN5OuterIvE6methodIvEEvvQ3cstITL0__EEN5InnernwEm and
    _ZZN5OuterIvE6methodIvEEvvQ3cstITL0__EEN5InnerdlEPv and in turn end
    up building NULL references.  The following puts in a safeguard for
    faile demangling into -Waccess.

            PR tree-optimization/115232
            * gimple-ssa-warn-access.cc (new_delete_mismatch_p): Handle
            failure to demangle gracefully.

            * g++.dg/pr115232.C: New testcase.

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

* [Bug tree-optimization/115232] [14/15 regression] ICE during GIMPLE pass during waccess
  2024-05-26 11:45 [Bug c++/115232] New: [14 regression] ICE during GIMPLE pass vopl at bk dot ru
                   ` (4 preceding siblings ...)
  2024-05-27  9:24 ` cvs-commit at gcc dot gnu.org
@ 2024-05-27  9:25 ` cvs-commit at gcc dot gnu.org
  2024-05-27  9:25 ` rguenth at gcc dot gnu.org
  2024-05-27  9:26 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-27  9:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:4790076933ef9337553c3fbbc52a93cce78c584f

commit r14-10247-g4790076933ef9337553c3fbbc52a93cce78c584f
Author: Richard Biener <rguenther@suse.de>
Date:   Mon May 27 09:13:11 2024 +0200

    tree-optimization/115232 - demangle failure during -Waccess

    For the following testcase we fail to demangle
    _ZZN5OuterIvE6methodIvEEvvQ3cstITL0__EEN5InnernwEm and
    _ZZN5OuterIvE6methodIvEEvvQ3cstITL0__EEN5InnerdlEPv and in turn end
    up building NULL references.  The following puts in a safeguard for
    faile demangling into -Waccess.

            PR tree-optimization/115232
            * gimple-ssa-warn-access.cc (new_delete_mismatch_p): Handle
            failure to demangle gracefully.

            * g++.dg/pr115232.C: New testcase.

    (cherry picked from commit 311d7f5c17b8969c7ed8e4f23178d6ec4752e33f)

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

* [Bug tree-optimization/115232] [14/15 regression] ICE during GIMPLE pass during waccess
  2024-05-26 11:45 [Bug c++/115232] New: [14 regression] ICE during GIMPLE pass vopl at bk dot ru
                   ` (5 preceding siblings ...)
  2024-05-27  9:25 ` cvs-commit at gcc dot gnu.org
@ 2024-05-27  9:25 ` rguenth at gcc dot gnu.org
  2024-05-27  9:26 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-27  9:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |14.1.0
             Status|ASSIGNED                    |RESOLVED
      Known to work|                            |14.1.1, 15.0
         Resolution|---                         |FIXED

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

* [Bug tree-optimization/115232] [14/15 regression] ICE during GIMPLE pass during waccess
  2024-05-26 11:45 [Bug c++/115232] New: [14 regression] ICE during GIMPLE pass vopl at bk dot ru
                   ` (6 preceding siblings ...)
  2024-05-27  9:25 ` rguenth at gcc dot gnu.org
@ 2024-05-27  9:26 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-27  9:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm opening a new bug for the demangle fail

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

end of thread, other threads:[~2024-05-27  9:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-26 11:45 [Bug c++/115232] New: [14 regression] ICE during GIMPLE pass vopl at bk dot ru
2024-05-26 12:00 ` [Bug c++/115232] " pinskia at gcc dot gnu.org
2024-05-26 12:00 ` [Bug tree-optimization/115232] [14/15 regression] ICE during GIMPLE pass during waccess pinskia at gcc dot gnu.org
2024-05-26 12:01 ` pinskia at gcc dot gnu.org
2024-05-27  7:10 ` rguenth at gcc dot gnu.org
2024-05-27  9:24 ` cvs-commit at gcc dot gnu.org
2024-05-27  9:25 ` cvs-commit at gcc dot gnu.org
2024-05-27  9:25 ` rguenth at gcc dot gnu.org
2024-05-27  9:26 ` 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).