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/109258] [13 Regression] go.test/test/fixedbugs/bug207.go ICEs
Date: Fri, 24 Mar 2023 22:02:55 +0000	[thread overview]
Message-ID: <bug-109258-4-PPMwxZSzmD@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109258-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 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:0849a188d539d78101a32deea63db4cb39fb55ac

commit r13-6858-g0849a188d539d78101a32deea63db4cb39fb55ac
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Mar 24 23:02:08 2023 +0100

    go: Fix up go.test/test/fixedbugs/bug207.go failure [PR109258]

    The PR109086 r13-6690 inline_string_cmp change to
          if (diff != result)
            emit_move_insn (result, diff);
    regressed
    FAIL: go.test/test/fixedbugs/bug207.go,  -O2 -g  (internal compiler error:
in emit_move_insn, at expr.cc:4224)
    The problem is the Go FE doesn't mark __builtin_memcmp as pure as other
FEs,
    so we ended up with
      __builtin_memcmp (whatever, whateverelse, somesize);
    in the IL before expansion and the expansion ICEd on it.
    As the builtin calls a library function which is pure or is inline expanded
    as such, not marking it pure is an unnecessary pessimization from the FE
    side, keeping such dead calls in the IL if they aren't needed will not help
    anything.

    The following patch fixes that.  Initially I've added just DECL_PURE_P to
    it, but that unfortunately broke bootstrap, for __builtin_memcmp there is
    also __builtin_memcmp_eq registered by the middle-end code if not
registered
    earlier and that one is registered with the usual flags (pure, nothrow,
    leaf), so if __builtin_memcmp from FE was just pure, it would appear in the
    IL as that it can raise exceptions and when folded into __builtin_memcmp_eq
    all of sudden it couldn't and we'd ICE in verification.

    I think tons of functions should have builtin_nothrow as well, but changing
    that wasn't necessary for this fix.

    2023-03-24  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/109258
            * go-gcc.cc (Gcc_backend): Add new static data members builtin_pure
            and builtin_nothrow.
            (Gcc_backend::Gcc_backend): Pass builtin_pure | builtin_nothrow for
            BUILT_IN_MEMCMP.
            (Gcc_backend::define_builtin): Handle builtin_pure and
builtin_nothrow
            in flags.

      parent reply	other threads:[~2023-03-24 22:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23  5:52 [Bug middle-end/109258] New: " pinskia at gcc dot gnu.org
2023-03-23  5:52 ` [Bug middle-end/109258] " pinskia at gcc dot gnu.org
2023-03-23  9:01 ` rguenth at gcc dot gnu.org
2023-03-23  9:35 ` jakub at gcc dot gnu.org
2023-03-23 10:06 ` jakub at gcc dot gnu.org
2023-03-23 10:10 ` jakub at gcc dot gnu.org
2023-03-23 10:21 ` jakub at gcc dot gnu.org
2023-03-23 10:21 ` jakub at gcc dot gnu.org
2023-03-24  9:40 ` cvs-commit at gcc dot gnu.org
2023-03-24 12:33 ` jakub at gcc dot gnu.org
2023-03-24 22:02 ` cvs-commit at gcc dot gnu.org [this message]

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-109258-4-PPMwxZSzmD@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).