From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D54403854828; Fri, 1 Dec 2023 21:12:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D54403854828 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701465164; bh=+42JY/9spIYTpL0CoQPUYUHMyi7fuHPO2+mj/BZFrMM=; h=From:To:Subject:Date:From; b=mTHJD06b60GytbGUjKLyT7ow2goBX+GlaHJ6OBbZ5EvM78I7EUdvWPqltITjzrZpn 0OugbIZluVTpgfBLiZbHP/S/tQ3pnlwzz0SPzAsRyob5/O3HqlJpkVh7GsIMY45ZnF nBDgBqx/bhPk037BlkwJByiGglq5q5rKgIUkOBg8= From: "a.elovikov at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/112816] New: internal compiler error: in extract_insn, at recog.cc:2804, unrecognizable_insn for __builtin_signbit Date: Fri, 01 Dec 2023 21:12:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: a.elovikov at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D112816 Bug ID: 112816 Summary: internal compiler error: in extract_insn, at recog.cc:2804, unrecognizable_insn for __builtin_signbit Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: a.elovikov at gmail dot com Target Milestone: --- https://godbolt.org/z/3vzejjWcq constexpr int N =3D 4; template struct S { T x[N]; T& operator[](int idx) { return x[idx]; } }; auto foo(S x) { S res; for (int i =3D 0; i < 4; ++i) res[i] =3D __builtin_signbit(x[i]) ? -1 : 0; return res; } Copy-pasting "x86-64 gcc (trunk)" output from the godbolt link above (-O3 -std=3Dc++17 options used): : In function 'auto foo(S)': :13:1: error: unrecognizable insn: 13 | } | ^ (insn 20 19 21 2 (set (reg:V4SI 99 [ vect__2.11 ]) (lshiftrt:V4SI (subreg:V4SI (subreg:V4SF (reg/v:TI 105 [ x ]) 0) 0) (const_int 31 [0x1f]))) "":11:31 discrim 1 -1 (nil)) during RTL pass: vregs :13:1: internal compiler error: in extract_insn, at recog.cc:2804 0x26c14fe internal_error(char const*, ...) ???:0 0xb125b9 fancy_abort(char const*, int, char const*) ???:0 0x925e6a _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) ???:0 0x925e8c _fatal_insn_not_found(rtx_def const*, char const*, int, char const= *) ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. Compiler returned: 1 Also reproducible with (the version I discovered it with) $ g++ --version g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.=