From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F3D253858C42; Fri, 26 Apr 2024 01:49:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F3D253858C42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714096147; bh=gdXjDYNBbllL4ODAHBdvrSMPsusT1oX2gJOk/y3AriM=; h=From:To:Subject:Date:From; b=CC6KhgMh0M9IqK7TS5nhJCiTLFNzLvPM8/DFHtkI1/jfrFR2w8enpdiE3R2Cw1kxv gF9dM84YCQDsD3CXZt3YZVRtZxs9aV5BFsOKWsAJOm/66ESLDIxMGN8y9wSKXWMIN2 sV31QoUb+0PK1sbeUz8QBTz3/JlVIaTq28U2oHmw= From: "iamanonymous.cs at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114858] New: Compilation Hang and Excessive RAM Consumption in GCC Date: Fri, 26 Apr 2024 01:49:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: iamanonymous.cs at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114858 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: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D $ cat bug.cpp template void g(F); template auto h(A &&... a) -> decltype(g(0, (g)(a)...)) { h([] {}); } int main() {=20 h();=20 return 0;=20 } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D I observed that when attempting to compile this code using GCC, the compila= tion 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(s= ee https://godbolt.org/z/P1c7f664f) The command we used is(no error output): =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D g++ bug.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The GCC version: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D $ gcc -v Using built-in specs. COLLECT_GCC=3Dgcc COLLECT_LTO_WRAPPER=3D/home/cTest/gcc/myinstall/libexec/gcc/x86_64-linux-gn= u/14.0.1/lto-wrapper Target: x86_64-linux-gnu Configured with: ../configure -v --build=3Dx86_64-linux-gnu --host=3Dx86_64-linux-gnu --target=3Dx86_64-linux-gnu --enable-checking=3Dno --enable-languages=3Dc,c++ --disable-multilib --prefix=3D/home/cTest/gcc/my= install --disable-bootstrap Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.1 20240329 (experimental) (GCC)=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=