public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/100508] ICE with '-g -O3': in expand_debug_locations, at cfgexpand.c:5618
Date: Wed, 12 May 2021 08:40:29 +0000	[thread overview]
Message-ID: <bug-100508-4-EgDxVLMiyf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100508-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:19040050aa2c8ee890fc58dda48639fc91bf0af0

commit r12-736-g19040050aa2c8ee890fc58dda48639fc91bf0af0
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed May 12 10:38:35 2021 +0200

    expand: Don't reuse DEBUG_EXPRs with vector type if they have different
modes [PR100508]

    The inliner doesn't remap DEBUG_EXPR_DECLs, so the same decls can appear
    in multiple functions.
    Furthermore, expansion reuses corresponding DEBUG_EXPRs too, so they again
    can be reused in multiple functions.
    Neither of that is a major problem, DEBUG_EXPRs are just magic value
holders
    and what value they stand for is independent in each function and driven by
    what debug stmts or DEBUG_INSNs they are bound to.
    Except for DEBUG_EXPR*s with vector types, TYPE_MODE can be either BLKmode
    or some vector mode depending on whether current function's enabled ISAs
    support that vector mode or not.  On the following testcase, we expand it
    first in foo function without AVX2 enabled and so the DEBUG_EXPR is
    BLKmode, but later the same DEBUG_EXPR_DECL is used in a simd clone with
    AVX2 enabled and expansion ICEs because of a mode mismatch.

    The following patch fixes that by forcing recreation of a DEBUG_EXPR if
    there is a mode mismatch for vector typed DEBUG_EXPR_DECL, DEBUG_EXPRs
    will be still reused in between functions otherwise and within the same
    function the mode should be always the same.

    2021-05-12  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/100508
            * cfgexpand.c (expand_debug_expr): For DEBUG_EXPR_DECL with vector
            type, don't reuse DECL_RTL if it has different mode, instead force
            creation of a new DEBUG_EXPR.

            * gcc.dg/gomp/pr100508.c: New test.

  parent reply	other threads:[~2021-05-12  8:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 19:25 [Bug c/100508] New: " cnsun at uwaterloo dot ca
2021-05-11  7:02 ` [Bug middle-end/100508] " rguenth at gcc dot gnu.org
2021-05-11  8:10 ` marxin at gcc dot gnu.org
2021-05-11  8:31 ` jakub at gcc dot gnu.org
2021-05-11  9:34 ` jakub at gcc dot gnu.org
2021-05-12  8:40 ` cvs-commit at gcc dot gnu.org [this message]
2021-05-12 13:25 ` cvs-commit at gcc dot gnu.org
2021-05-12 13:25 ` jakub at gcc dot gnu.org
2022-05-10  8:17 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:19 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:34 ` jakub 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-100508-4-EgDxVLMiyf@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).