public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114858] New: Compilation Hang and Excessive RAM Consumption in GCC
@ 2024-04-26  1:49 iamanonymous.cs at gmail dot com
  2024-04-26  1:55 ` [Bug c++/114858] [11/12/13/14 regression] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: iamanonymous.cs at gmail dot com @ 2024-04-26  1:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114858
           Summary: Compilation Hang and Excessive RAM Consumption in GCC
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

The following code snippet triggers a hang issue:
============================================
$ cat bug.cpp

template <class F> void g(F);
template <class... A>
auto h(A &&... a) -> decltype(g(0,
(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype(g<decltype()>)(a)...))
{
  h([] {});
}

int main() { 
  h(); 
  return 0; 
}
============================================
I observed that when attempting to compile this code using GCC, the compilation
process hangs indefinitely, without providing any output or indicating
successful compilation. Additionally, the RAM usage continuously increases,
leading to excessive consumption of system resources.

However, it is worth noting that when using LLVM as the compiler, the code
compiles quickly and produces the expected compilation output.

We have found that this issue still persists in the latest version of GCC(see
https://godbolt.org/z/P1c7f664f)

The command we used is(no error output):
============================================
g++ bug.cpp
============================================


The GCC version:
============================================
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/cTest/gcc/myinstall/libexec/gcc/x86_64-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../configure -v --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu --enable-checking=no
--enable-languages=c,c++ --disable-multilib --prefix=/home/cTest/gcc/myinstall
--disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240329 (experimental) (GCC) 
============================================

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

end of thread, other threads:[~2024-04-28  1:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26  1:49 [Bug c++/114858] New: Compilation Hang and Excessive RAM Consumption in GCC iamanonymous.cs at gmail dot com
2024-04-26  1:55 ` [Bug c++/114858] [11/12/13/14 regression] " pinskia at gcc dot gnu.org
2024-04-26  1:56 ` [Bug c++/114858] [11/12/13/14 regression] Compilation Hang and Excessive RAM Consumption in GCC with invalid input pinskia at gcc dot gnu.org
2024-04-26  7:22 ` [Bug c++/114858] [11/12/13/14 regression] Compilation Hang and Excessive RAM Consumption in GCC with invalid input since r0-128725 jakub at gcc dot gnu.org
2024-04-28  1:55 ` [Bug c++/114858] [11/12/13/14/15 " hp 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).