From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CE6FD3858CDA; Fri, 24 Mar 2023 22:02:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE6FD3858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679695375; bh=e3Cs1rFI+u1Mq8Ii5HmvkBAIL++KokozRn5hrFB0dcg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qAldQ05/mwjmrz07rdRhGeGBP+of/z+mv0XhXuXAPhudfmi0SJ4mxKQ6acmpnlcjQ 8Tna/Hb592fGyUmt3RKOXlFEt/5RJSRzyYKiCAao2msFytkw5VDhKz9xnF/TdXh6lm oK+8THcMkftqu9EO0TQFgGmim6FslKSg1G3iBWWc= From: "cvs-commit at gcc dot 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 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: ice-on-valid-code, testsuite-fail X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D109258 --- Comment #8 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:0849a188d539d78101a32deea63db4cb39fb55ac commit r13-6858-g0849a188d539d78101a32deea63db4cb39fb55ac Author: Jakub Jelinek 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 !=3D result) emit_move_insn (result, diff); regressed FAIL: go.test/test/fixedbugs/bug207.go, -O2 -g (internal compiler err= or: 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 expa= nded 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_memcm= p_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 chan= ging that wasn't necessary for this fix. 2023-03-24 Jakub Jelinek 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.=