public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/112816] New: internal compiler error: in extract_insn, at recog.cc:2804, unrecognizable_insn for __builtin_signbit
@ 2023-12-01 21:12 a.elovikov at gmail dot com
  2023-12-01 21:17 ` [Bug target/112816] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: a.elovikov at gmail dot com @ 2023-12-01 21:12 UTC (permalink / raw)
  To: gcc-bugs

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

            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 = 4;

template <typename T>
struct S {
    T x[N];
    T& operator[](int idx) { return x[idx]; }
};
auto foo(S<float> x) {
  S<int> res;
  for (int i = 0; i < 4; ++i)
    res[i] = __builtin_signbit(x[i]) ? -1 : 0;
  return res;
}

Copy-pasting "x86-64 gcc (trunk)" output from the godbolt link above (-O3
-std=c++17 options used):
<source>: In function 'auto foo(S<float>)':
<source>: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]))) "<source>":11:31 discrim 1 -1
     (nil))
during RTL pass: vregs
<source>: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 <https://gcc.gnu.org/bugs/> 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.

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2023-12-19  9:46 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-01 21:12 [Bug middle-end/112816] New: internal compiler error: in extract_insn, at recog.cc:2804, unrecognizable_insn for __builtin_signbit a.elovikov at gmail dot com
2023-12-01 21:17 ` [Bug target/112816] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-12-01 21:19 ` pinskia at gcc dot gnu.org
2023-12-01 21:20 ` [Bug target/112816] [11/12/13/14 Regression] ICE unrecognizable_insn with __builtin_signbit and returning struct with int[4] pinskia at gcc dot gnu.org
2023-12-02  9:05 ` jakub at gcc dot gnu.org
2023-12-02  9:10 ` jakub at gcc dot gnu.org
2023-12-02  9:16 ` jakub at gcc dot gnu.org
2023-12-04  4:12 ` liuhongt at gcc dot gnu.org
2023-12-04  8:01 ` cvs-commit at gcc dot gnu.org
2023-12-04  8:02 ` [Bug target/112816] [11/12/13 " jakub at gcc dot gnu.org
2023-12-04 17:04 ` a.elovikov at gmail dot com
2023-12-05  8:09 ` cvs-commit at gcc dot gnu.org
2023-12-05 16:32 ` cvs-commit at gcc dot gnu.org
2023-12-05 17:02 ` [Bug target/112816] [11/12 " jakub at gcc dot gnu.org
2023-12-16  0:38 ` cvs-commit at gcc dot gnu.org
2023-12-17 13:55 ` cvs-commit at gcc dot gnu.org
2023-12-18 19:30 ` a.elovikov at gmail dot com
2023-12-18 20:03 ` jakub at gcc dot gnu.org
2023-12-19  9:25 ` cvs-commit at gcc dot gnu.org
2023-12-19  9:33 ` cvs-commit at gcc dot gnu.org
2023-12-19  9:37 ` cvs-commit at gcc dot gnu.org
2023-12-19  9:45 ` cvs-commit at gcc dot gnu.org
2023-12-19  9:46 ` jakub at gcc dot gnu.org

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).