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/113228] [14 Regression] ICE: recalculate_side_effects, at gimplify.cc:3347 since r14-6420
Date: Mon, 08 Jan 2024 13:00:56 +0000	[thread overview]
Message-ID: <bug-113228-4-KlqQMJqf2H@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113228-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #15 from GCC 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:8c0dd8a6ff85d6e7b38957f2da400f5cfa8fef6b

commit r14-7002-g8c0dd8a6ff85d6e7b38957f2da400f5cfa8fef6b
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Jan 8 13:59:15 2024 +0100

    gimplify: Fix ICE in recalculate_side_effects [PR113228]

    The following testcase ICEs during regimplificatgion since the addition of
    (convert (eqne zero_one_valued_p@0 INTEGER_CST@1))
    simplification.  That simplification is novel in the sense that in
    gimplify_expr it can turn an expression (comparison in particular) into
    a SSA_NAME.  Normally when gimplify_expr sees originally a SSA_NAME, it
does
            case SSA_NAME:
              /* Allow callbacks into the gimplifier during optimization.  */
              ret = GS_ALL_DONE;
              break;
    and doesn't try to recalculate side effects because of that, but in this
    case gimplify_expr normally enters the:
            default:
              switch (TREE_CODE_CLASS (TREE_CODE (*expr_p)))
                {
                case tcc_comparison:
    then does
                          *expr_p = gimple_boolify (*expr_p);
    and then
                              *expr_p = fold_convert_loc (input_location,
                                                          org_type, *expr_p);
    with this new match.pd simplification turns that tcc_comparison class
    into SSA_NAME.  Unlike the outer SSA_NAME handling though, this falls
    through into
              recalculate_side_effects (*expr_p);

            dont_recalculate:
              break;
    but unfortunately recalculate_side_effects doesn't handle SSA_NAME and ICEs
    on it.
    SSA_NAMEs don't ever have TREE_SIDE_EFFECTS set on those, so the following
    patch fixes it by handling it similarly to the tcc_constant case.

    2024-01-08  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/113228
            * gimplify.cc (recalculate_side_effects): Do nothing for SSA_NAMEs.

            * gcc.c-torture/compile/pr113228.c: New test.

  parent reply	other threads:[~2024-01-08 13:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-04  2:42 [Bug middle-end/113228] New: [14 Regression] ICE: recalculate_side_effects, at gimplify.cc:3347 patrick at rivosinc dot com
2024-01-04  2:43 ` [Bug middle-end/113228] " patrick at rivosinc dot com
2024-01-04  2:51 ` pinskia at gcc dot gnu.org
2024-01-04  2:59 ` pinskia at gcc dot gnu.org
2024-01-04  3:02 ` pinskia at gcc dot gnu.org
2024-01-04  3:05 ` pinskia at gcc dot gnu.org
2024-01-04  3:28 ` pinskia at gcc dot gnu.org
2024-01-04  4:19 ` pinskia at gcc dot gnu.org
2024-01-04  5:48 ` pinskia at gcc dot gnu.org
2024-01-04 16:24 ` patrick at rivosinc dot com
2024-01-04 16:28 ` pinskia at gcc dot gnu.org
2024-01-04 16:33 ` patrick at rivosinc dot com
2024-01-05 11:31 ` [Bug middle-end/113228] [14 Regression] ICE: recalculate_side_effects, at gimplify.cc:3347 since r14-6420 jakub at gcc dot gnu.org
2024-01-05 12:06 ` jakub at gcc dot gnu.org
2024-01-05 12:38 ` jakub at gcc dot gnu.org
2024-01-05 22:29 ` pinskia at gcc dot gnu.org
2024-01-08 13:00 ` cvs-commit at gcc dot gnu.org [this message]
2024-01-08 13:01 ` 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-113228-4-KlqQMJqf2H@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).