public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106876] New: [13 Regression] ICE in extract_insn, at recog.cc:2791
@ 2022-09-07 17:19 gscfq@t-online.de
  2022-09-07 19:41 ` [Bug target/106876] [13 Regression] ICE in extract_insn, at recog.cc:2791 since r13-465-g4df735e01e319997 marxin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gscfq@t-online.de @ 2022-09-07 17:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106876
           Summary: [13 Regression] ICE in extract_insn, at recog.cc:2791
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Started between 20220508 and 20220515, with file g++.dg/lookup/friend23.C :


$ cat friend23.C
template <class Derived>
struct base {
  friend void bar(Derived& d) {
    d.bar(); // access in inline friend of friend, ok?
  }
};

class derived : base<derived> {
  friend class base<derived>;
  void bar() {}
};

int main() {
  derived d;
  bar(d);
}


$ g++-13-20220904 -c friend23.C -mforce-indirect-call -fPIC -fprofile-generate
friend23.C: In member function 'void derived::bar()':
friend23.C:10:15: error: unrecognizable insn:
   10 |   void bar() {}
      |               ^
(call_insn/u 6 3 7 2 (parallel [
            (set (reg:DI 0 ax)
                (call:DI (mem:QI (symbol_ref:DI ("__tls_get_addr")) [0  S1 A8])
                    (const_int 0 [0])))
            (unspec:DI [
                    (symbol_ref:DI ("__gcov_indirect_call") [flags 0x50]
<var_decl 0x7ff13818c1b0 __gcov_indirect_call>)
                    (reg/f:DI 7 sp)
                ] UNSPEC_TLS_GD)
        ]) -1
     (expr_list:REG_EH_REGION (const_int -2147483648 [0xffffffff80000000])
        (nil))
    (nil))
during RTL pass: vregs
friend23.C:10:15: internal compiler error: in extract_insn, at recog.cc:2791
0x6f0204 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ../../gcc/rtl-error.cc:108
0x6f0223 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ../../gcc/rtl-error.cc:116
0x110e617 extract_insn(rtx_insn*)
        ../../gcc/recog.cc:2791
0xe07089 instantiate_virtual_regs_in_insn
        ../../gcc/function.cc:1660
0xe07089 instantiate_virtual_regs
        ../../gcc/function.cc:1985
0xe07089 execute
        ../../gcc/function.cc:2034

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

* [Bug target/106876] [13 Regression] ICE in extract_insn, at recog.cc:2791 since r13-465-g4df735e01e319997
  2022-09-07 17:19 [Bug c++/106876] New: [13 Regression] ICE in extract_insn, at recog.cc:2791 gscfq@t-online.de
@ 2022-09-07 19:41 ` marxin at gcc dot gnu.org
  2022-09-08  1:31 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-09-07 19:41 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
            Summary|[13 Regression] ICE in      |[13 Regression] ICE in
                   |extract_insn, at            |extract_insn, at
                   |recog.cc:2791               |recog.cc:2791 since
                   |                            |r13-465-g4df735e01e319997
   Last reconfirmed|                            |2022-09-07

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r13-465-g4df735e01e319997.

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

* [Bug target/106876] [13 Regression] ICE in extract_insn, at recog.cc:2791 since r13-465-g4df735e01e319997
  2022-09-07 17:19 [Bug c++/106876] New: [13 Regression] ICE in extract_insn, at recog.cc:2791 gscfq@t-online.de
  2022-09-07 19:41 ` [Bug target/106876] [13 Regression] ICE in extract_insn, at recog.cc:2791 since r13-465-g4df735e01e319997 marxin at gcc dot gnu.org
@ 2022-09-08  1:31 ` pinskia at gcc dot gnu.org
  2022-09-08  1:34 ` [Bug target/106876] ICE in extract_insn with -mforce-indirect-call -fPIC -fprofile-generate pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-09-08  1:31 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0
           Keywords|                            |ice-on-valid-code

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #1)
> Started with r13-465-g4df735e01e319997.

That might just allowed the testcase to be accepted. I suspect there might be
another one which is accepted before that ...

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

* [Bug target/106876] ICE in extract_insn with -mforce-indirect-call -fPIC -fprofile-generate
  2022-09-07 17:19 [Bug c++/106876] New: [13 Regression] ICE in extract_insn, at recog.cc:2791 gscfq@t-online.de
  2022-09-07 19:41 ` [Bug target/106876] [13 Regression] ICE in extract_insn, at recog.cc:2791 since r13-465-g4df735e01e319997 marxin at gcc dot gnu.org
  2022-09-08  1:31 ` pinskia at gcc dot gnu.org
@ 2022-09-08  1:34 ` pinskia at gcc dot gnu.org
  2022-09-08  1:35 ` [Bug target/106876] ICE in extract_insn with -mforce-indirect-call -fPIC and TLS pinskia at gcc dot gnu.org
  2022-09-08  1:36 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-09-08  1:34 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |8.1.0
            Summary|[13 Regression] ICE in      |ICE in extract_insn with
                   |extract_insn, at            |-mforce-indirect-call -fPIC
                   |recog.cc:2791 since         |-fprofile-generate
                   |r13-465-g4df735e01e319997   |

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
A simple change like this (changing everything to struct causing everything to
be public) shows the problem has been there since GCC 8 (when
-mforce-indirect-call support was added).

```
template <class Derived>
struct base {
  friend void bar(Derived& d) {
    d.bar();
  }
};

struct derived : base<derived> {
  friend class base<derived>;
  void bar() {}
};

int main() {
  derived d;
  bar(d);
}
```
-mforce-indirect-call -fPIC -fprofile-generate -g0
```
<source>: In member function 'void derived::bar()':
<source>:11:15: error: unrecognizable insn:
   void bar() {}
               ^
(call_insn/u 6 3 7 2 (parallel [
            (set (reg:DI 0 ax)
                (call:DI (mem:QI (symbol_ref:DI ("__tls_get_addr")) [0  S1 A8])
                    (const_int 0 [0])))
            (unspec:DI [
                    (symbol_ref:DI ("__gcov_indirect_call_callee") [flags 0x50]
<var_decl 0x7f58d6ae95a0 __gcov_indirect_call_callee>)
                    (reg/f:DI 7 sp)
                ] UNSPEC_TLS_GD)
        ]) -1
     (expr_list:REG_EH_REGION (const_int -2147483648 [0xffffffff80000000])
        (nil))
    (nil))
during RTL pass: vregs
dump file: <source>.235r.vregs
<source>:11:15: internal compiler error: in extract_insn, at recog.c:2304
```

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

* [Bug target/106876] ICE in extract_insn with -mforce-indirect-call -fPIC and TLS
  2022-09-07 17:19 [Bug c++/106876] New: [13 Regression] ICE in extract_insn, at recog.cc:2791 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2022-09-08  1:34 ` [Bug target/106876] ICE in extract_insn with -mforce-indirect-call -fPIC -fprofile-generate pinskia at gcc dot gnu.org
@ 2022-09-08  1:35 ` pinskia at gcc dot gnu.org
  2022-09-08  1:36 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-09-08  1:35 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|13.0                        |---

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

* [Bug target/106876] ICE in extract_insn with -mforce-indirect-call -fPIC and TLS
  2022-09-07 17:19 [Bug c++/106876] New: [13 Regression] ICE in extract_insn, at recog.cc:2791 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2022-09-08  1:35 ` [Bug target/106876] ICE in extract_insn with -mforce-indirect-call -fPIC and TLS pinskia at gcc dot gnu.org
@ 2022-09-08  1:36 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-09-08  1:36 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 89289.

*** This bug has been marked as a duplicate of bug 89289 ***

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

end of thread, other threads:[~2022-09-08  1:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07 17:19 [Bug c++/106876] New: [13 Regression] ICE in extract_insn, at recog.cc:2791 gscfq@t-online.de
2022-09-07 19:41 ` [Bug target/106876] [13 Regression] ICE in extract_insn, at recog.cc:2791 since r13-465-g4df735e01e319997 marxin at gcc dot gnu.org
2022-09-08  1:31 ` pinskia at gcc dot gnu.org
2022-09-08  1:34 ` [Bug target/106876] ICE in extract_insn with -mforce-indirect-call -fPIC -fprofile-generate pinskia at gcc dot gnu.org
2022-09-08  1:35 ` [Bug target/106876] ICE in extract_insn with -mforce-indirect-call -fPIC and TLS pinskia at gcc dot gnu.org
2022-09-08  1:36 ` pinskia 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).