From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B88703858436; Sun, 13 Nov 2022 14:23:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B88703858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668349416; bh=UBEP6zAjAqtHhdz7ske+BVO9nAqK1XfD55DMEmEQk6E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nHfGUdM4LCqcl2tro5mfLVcT9xl6J/DIb2YisR91pcBsZHVS9Kb4iaMyx9LnD71aM X0opCn2RlBESJ3Ei7jsdBagtT3YZYVC/7/yDKeB+3ejQVlcCwM0hoxn8+8FWCiHQC5 UW8mO+onbPx0UNgy5qMRfkXuf5l3dizSqGHiQdn8= 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 since r13-3358-ge0403e95689af7 Date: Sun, 13 Nov 2022 14:23:36 +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: short_desc 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 Sergei Trofimovich changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|[13 Regression] lambdas get |[13 Regression] lambdas get |merged incorrectly in |merged incorrectly in |tempaltes, cause llvm-12 |tempaltes, cause llvm-12 |miscompilation |miscompilation since | |r13-3358-ge0403e95689af7 --- Comment #5 from Sergei Trofimovich --- Bisected down to r13-3358-ge0403e95689af7 (looks very relevant): commit e0403e95689af7d562c7d04f706e9e25115747ff Author: Martin Jambor Date: Tue Oct 18 14:14:26 2022 +0200 ipa-cp: Better representation of aggregate values we clone for This patch replaces linked lists of ipa_agg_replacement_value with vectors of similar structures called ipa_argagg_value and simplifies how we compute them in the first place. Having a vector should also result in less overhead when allocating and because we keep it sorted, it leads to logarithmic searches. The slightly obnoxious "argagg" bit in the name can be changed into "agg" after the next patch removes our current ipa_agg_value type. The patch also introduces type ipa_argagg_value_list which serves as a common view into a vector of ipa_argagg_value structures regardless whether they are stored in GC memory (required for IPA-CP transformation summary because we store trees) or in an auto_vec which is hopefully usually only allocated on stack. The calculation of aggreagete costant values for a given subsert of callers is then rewritten to compute known constants for each edge (some pruning to skip obviously not needed is still employed and should not be really worse than what I am replacing) and these vectors are there intersected, which can be done linearly since they are sorted. The patch also removes a lot of heap allocations of small lists of aggregate values and replaces them with stack based auto_vecs. As Richard Sandiford suggested, I use std::lower_bound from rather than re-implementing bsearch for array_slice. The patch depends on the patch which adds the ability to construct array_slices from gc-allocated vectors.=