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

* [Bug c++/114858] [11/12/13/14 regression] Compilation Hang and Excessive RAM Consumption in GCC
  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 ` 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
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-26  1:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.8.4, 4.8.5
      Known to work|                            |4.8.2, 4.8.3
   Target Milestone|---                         |11.5
            Summary|Compilation Hang and        |[11/12/13/14 regression]
                   |Excessive RAM Consumption   |Compilation Hang and
                   |in GCC                      |Excessive RAM Consumption
                   |                            |in GCC

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

* [Bug c++/114858] [11/12/13/14 regression] Compilation Hang and Excessive RAM Consumption in GCC with invalid input
  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 ` 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
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-26  1:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
            Summary|[11/12/13/14 regression]    |[11/12/13/14 regression]
                   |Compilation Hang and        |Compilation Hang and
                   |Excessive RAM Consumption   |Excessive RAM Consumption
                   |in GCC                      |in GCC with invalid input
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-04-26

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. Looks like a patch which was backported to the GCC 4.8.4 release is
the cause.

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

* [Bug c++/114858] [11/12/13/14 regression] Compilation Hang and Excessive RAM Consumption in GCC with invalid input since r0-128725
  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 ` 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
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-04-26  7:22 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[11/12/13/14 regression]    |[11/12/13/14 regression]
                   |Compilation Hang and        |Compilation Hang and
                   |Excessive RAM Consumption   |Excessive RAM Consumption
                   |in GCC with invalid input   |in GCC with invalid input
                   |                            |since r0-128725
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org,
                   |                            |ppalka at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Seems it started to hang with
r0-128725-g5d264d62dc6d381510bea36469d50175fa6a39c2
Before that commit it has been rejected with many errors.

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

* [Bug c++/114858] [11/12/13/14/15 regression] Compilation Hang and Excessive RAM Consumption in GCC with invalid input since r0-128725
  2024-04-26  1:49 [Bug c++/114858] New: Compilation Hang and Excessive RAM Consumption in GCC iamanonymous.cs at gmail dot com
                   ` (2 preceding siblings ...)
  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 ` hp at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: hp at gcc dot gnu.org @ 2024-04-28  1:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
Looks like it slowly chews up memory.  I killed an -O2 run when cc1plus had
consumed 110 GiB, x86_64-linux at r14-10114-g09680e3ee7d7.

^ 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).