public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "slyfox at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-107661-4-kBNL0m2UoA@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107661-4@http.gcc.gnu.org/bugzilla/>

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

Sergei Trofimovich <slyfox at gcc dot gnu.org> 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 <slyfox at gcc dot gnu.org> ---
Bisected down to r13-3358-ge0403e95689af7 (looks very relevant):

commit e0403e95689af7d562c7d04f706e9e25115747ff
Author: Martin Jambor <mjambor@suse.cz>
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
    <algorithm> 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.

  parent reply	other threads:[~2022-11-13 14:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-12 18:06 [Bug middle-end/107661] New: [13 Regression] lambdas get merged incorrectly in tempaltes, cause llvm-12 miscompilation slyfox at gcc dot gnu.org
2022-11-12 18:13 ` [Bug middle-end/107661] " pinskia at gcc dot gnu.org
2022-11-12 18:21 ` slyfox at gcc dot gnu.org
2022-11-12 20:16 ` slyfox at gcc dot gnu.org
2022-11-12 22:47 ` slyfox at gcc dot gnu.org
2022-11-13 14:23 ` slyfox at gcc dot gnu.org [this message]
2022-11-13 14:57 ` [Bug middle-end/107661] [13 Regression] lambdas get merged incorrectly in tempaltes, cause llvm-12 miscompilation since r13-3358-ge0403e95689af7 jamborm at gcc dot gnu.org
2022-11-14 13:55 ` rguenth at gcc dot gnu.org
2022-11-15 23:21 ` slyfox at gcc dot gnu.org
2022-11-18  8:42 ` slyfox at gcc dot gnu.org
2022-11-18  8:43 ` slyfox at gcc dot gnu.org
2022-11-18  8:54 ` slyfox at gcc dot gnu.org
2022-11-19 20:11 ` slyfox at gcc dot gnu.org
2022-11-19 20:29 ` slyfox at gcc dot gnu.org
2022-11-20 21:26 ` slyfox at gcc dot gnu.org
2022-11-21 22:52 ` jamborm at gcc dot gnu.org
2022-11-22 14:13 ` [Bug ipa/107661] " jamborm at gcc dot gnu.org
2022-11-22 17:30 ` cvs-commit at gcc dot gnu.org
2022-11-22 17:33 ` jamborm at gcc dot gnu.org
2022-11-24 22:46 ` slyfox at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107661-4-kBNL0m2UoA@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).