From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D6D7B3858410; Sat, 12 Nov 2022 18:21:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6D7B3858410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668277286; bh=lfPAMxxDackHE91lkS8EGHfFtZlqCTCbmNWBv9r4iEY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ELDR48O9ocXYiTayZLgftkZxv8Hh/qc/+ENFVVWGNrAhnUIsI7Qck2+OqDqM88cx2 Dz3MCTpuf5HD4lPYbxsCXMj1TwrGomWUA6e9W77oHOkbr3X1YKXDZGzMFh9IVHoECN 4pdg8yK0hJjfzOKexJqGSqj2zygfLbwQP9Qes7L8= From: "slyfox at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/107661] [13 Regression] lambdas get merged incorrectly in tempaltes, cause llvm-12 miscompilation Date: Sat, 12 Nov 2022 18:21:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: needs-bisection, wrong-code X-Bugzilla-Severity: blocker X-Bugzilla-Who: slyfox at gcc dot gnu.org 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: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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=3D107661 --- Comment #2 from Sergei Trofimovich --- (In reply to Sergei Trofimovich from comment #0) > Reproducing: >=20 > $ ./gcc-13-HEAD/bin/gcc -Wall -O0 a.cc -o a > $ ./gcc-13-HEAD/bin/gcc -Wall -O3 a.cc -o a > ./bug_HEAD.bash: line 6: 1309437 Illegal instruction (core dumped) ./a > $ ./gcc-13-HEAD/bin/gcc -Wall -O0 -DDISABLE_HACK a.cc -o a > $ ./gcc-13-HEAD/bin/gcc -Wall -O3 -DDISABLE_HACK a.cc -o a Whoops. Lines miss `&& ./a` execution. The correct reproducer (it's a runti= me crash): $ ./gcc-13-HEAD/bin/gcc -Wall -O3 a.cc -o a && ./a Illegal instruction (core dumped) For comparison the other modes are fine: # remove seemingly unused code with __builtin_trap from visibility: $ ./gcc-13-HEAD/bin/gcc -Wall -O3 a.cc -o a -DDISABLE_HACK && ./a =