public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/107944] New: ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7
@ 2022-12-01  9:12 marxin at gcc dot gnu.org
  2022-12-01  9:12 ` [Bug ipa/107944] " marxin at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-12-01  9:12 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107944
           Summary: ICE in cgraph_node::get_untransformed_body since
                    r13-48-g27ee75dbe81bb7
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: jamborm at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---

Created attachment 53994
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53994&action=edit
Reproducer

I noticed that while building libbackend.a with -flto and partial linking and I
tried to reduce it to something smaller. However, the result is still pretty
big.

$ g++ -w -O2 -flto -c *.ii -fno-exceptions -Wfatal-errors && g++ -Wfatal-errors
-flinker-output=nolto-rel -r -o libbackend.a -flto=1 [123456].o -w
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: 3.o
(symbol from plugin): in function `global_trees_6':
(.text+0x0): multiple definition of `integer_types_0'; 1.o (symbol from
plugin):(.text+0x0): first defined here
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: 3.o
(symbol from plugin): in function `global_trees_6':
(.text+0x0): multiple definition of `__trans_tmp_2'; 2.o (symbol from
plugin):(.text+0x0): first defined here
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: 3.o
(symbol from plugin): in function `global_trees_6':
(.text+0x0): multiple definition of `__trans_tmp_3'; 2.o (symbol from
plugin):(.text+0x0): first defined here
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: 6.o
(symbol from plugin): in function `__trans_tmp_1':
(.text+0x0): multiple definition of `__trans_tmp_1'; 2.o (symbol from
plugin):(.text+0x0): first defined here
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: 6.o
(symbol from plugin): in function `__trans_tmp_1':
(.text+0x0): multiple definition of `space_nelems'; 4.o (symbol from
plugin):(.text+0x0): first defined here
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: 6.o
(symbol from plugin): in function `__trans_tmp_1':
(.text+0x0): multiple definition of `reserve_reserve'; 4.o (symbol from
plugin):(.text+0x0): first defined here
1.ii:67:8: note: type ‘struct tree_base’ itself violates the C++ One Definition
Rule
   67 | struct tree_base {
      |        ^
2.ii:452:8: note: the incompatible type is defined here
  452 | struct tree_base {
      |        ^
2.ii:456:12: note: type ‘struct <anon>’ itself violates the C++ One Definition
Rule
  456 |     struct {
      |            ^
3.ii:340:18: note: the incompatible type is defined here
  340 |           struct {
      |                  ^
2.ii:143:7: note: type name ‘hash_table<hash_map<tree_node*, tree_node*,
simple_hashmap_traits<default_hash_traits<tree_node*>, tree_node*>
>::hash_entry, false, xcallocator>’ should match type name ‘hash_table<int,
false, xcallocator>’
  143 | class hash_table {
      |       ^
3.ii:237:131: note: the incompatible type is defined here
  237 |         template <typename Descriptor, bool Lazy = false,          
template <typename Type> class Allocator = xcallocator> class hash_table {
      |                                                                        
                                                          ^
2.ii:143:7: note: type ‘struct hash_table’ itself violates the C++ One
Definition Rule
  143 | class hash_table {
      |       ^
3.ii:237:131: note: the incompatible type is defined here
  237 |         template <typename Descriptor, bool Lazy = false,          
template <typename Type> class Allocator = xcallocator> class hash_table {
      |                                                                        
                                                          ^
lto-wrapper: warning: using serial compilation of 3 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
during IPA pass: inline
In function ‘reserve’,
    inlined from ‘reserve’ at 4.ii:210:19,
    inlined from ‘reserve’ at 4.ii:199:35,
    inlined from ‘safe_push’ at 4.ii:220:10,
    inlined from ‘optimize_stmt’ at 4.ii:2254:36:
4.ii:142:52: internal compiler error: Segmentation fault
  142 |   unsigned alloc = vec_prefix::calculate_allocation(v ? &v->m_vecpfx :
0,
      |                                                    ^
0x102f987 internal_error(char const*, ...)
        ???:0
0x117935b cgraph_node::get_untransformed_body()
        ???:0
0x123f6e9 optimize_inline_calls(tree_node*)
        ???:0
0x123e4d2 inline_transform(cgraph_node*)
        ???:0
0x123da5f execute_all_ipa_transforms(bool)
        ???:0
0x15ebe1b cgraph_node::expand()
        ???:0
0x15e2f6d symbol_table::compile()
        ???:0
0x15d0368 lto_main()
        ???: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://bugs.opensuse.org/> for instructions.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status

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

* [Bug ipa/107944] ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7
  2022-12-01  9:12 [Bug ipa/107944] New: ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7 marxin at gcc dot gnu.org
@ 2022-12-01  9:12 ` marxin at gcc dot gnu.org
  2022-12-01  9:52 ` [Bug ipa/107944] [12/13 Regression] " rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-12-01  9:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |marxin at gcc dot gnu.org
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=100413
   Last reconfirmed|                            |2022-12-01
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
I've got a patch candidate that I'm testing right now. Note the mentioned patch
was backported, that's why I see it with GCC 12 as well.

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

* [Bug ipa/107944] [12/13 Regression] ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7
  2022-12-01  9:12 [Bug ipa/107944] New: ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7 marxin at gcc dot gnu.org
  2022-12-01  9:12 ` [Bug ipa/107944] " marxin at gcc dot gnu.org
@ 2022-12-01  9:52 ` rguenth at gcc dot gnu.org
  2022-12-21 10:59 ` [Bug ipa/107944] [11/12/13 " rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-12-01  9:52 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE in                      |[12/13 Regression] ICE in
                   |cgraph_node::get_untransfor |cgraph_node::get_untransfor
                   |med_body since              |med_body since
                   |r13-48-g27ee75dbe81bb7      |r13-48-g27ee75dbe81bb7
   Target Milestone|---                         |12.3

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

* [Bug ipa/107944] [11/12/13 Regression] ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7
  2022-12-01  9:12 [Bug ipa/107944] New: ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7 marxin at gcc dot gnu.org
  2022-12-01  9:12 ` [Bug ipa/107944] " marxin at gcc dot gnu.org
  2022-12-01  9:52 ` [Bug ipa/107944] [12/13 Regression] " rguenth at gcc dot gnu.org
@ 2022-12-21 10:59 ` rguenth at gcc dot gnu.org
  2022-12-28  9:21 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-12-21 10:59 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
      Known to work|                            |11.2.0, 12.1.0
      Known to fail|                            |11.3.0, 12.2.0, 13.0

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

* [Bug ipa/107944] [11/12/13 Regression] ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7
  2022-12-01  9:12 [Bug ipa/107944] New: ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7 marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-12-21 10:59 ` [Bug ipa/107944] [11/12/13 " rguenth at gcc dot gnu.org
@ 2022-12-28  9:21 ` marxin at gcc dot gnu.org
  2023-01-18 14:44 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-12-28  9:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Patch candidate:
https://gcc.gnu.org/pipermail/gcc-patches/2022-December/607623.html

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

* [Bug ipa/107944] [11/12/13 Regression] ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7
  2022-12-01  9:12 [Bug ipa/107944] New: ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7 marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-12-28  9:21 ` marxin at gcc dot gnu.org
@ 2023-01-18 14:44 ` cvs-commit at gcc dot gnu.org
  2023-02-01 17:58 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-18 14:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Jambor <jamborm@gcc.gnu.org>:

https://gcc.gnu.org/g:db959e250077ae6b4fc08f53fb322719582c5de6

commit r13-5243-gdb959e250077ae6b4fc08f53fb322719582c5de6
Author: Martin Jambor <mjambor@suse.cz>
Date:   Wed Jan 18 15:29:54 2023 +0100

    ipa: Release body more carefully when removing nodes (PR 107944)

    The code removing function bodies when the last call graph clone of a
    node is removed is too aggressive when there are nodes up the
    clone_of chain which still need them.  Fixed by expanding the check.

    gcc/ChangeLog:

    2023-01-18  Martin Jambor  <mjambor@suse.cz>

            PR ipa/107944
            * cgraph.cc (cgraph_node::remove): Check whether nodes up the
            lcone_of chain also do not need the body.

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

* [Bug ipa/107944] [11/12/13 Regression] ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7
  2022-12-01  9:12 [Bug ipa/107944] New: ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7 marxin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-01-18 14:44 ` cvs-commit at gcc dot gnu.org
@ 2023-02-01 17:58 ` cvs-commit at gcc dot gnu.org
  2023-02-02 11:28 ` cvs-commit at gcc dot gnu.org
  2023-02-02 11:30 ` jamborm at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-02-01 17:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Martin Jambor
<jamborm@gcc.gnu.org>:

https://gcc.gnu.org/g:8495d80f44488b2566afc84b3f5704dd7c999e21

commit r12-9096-g8495d80f44488b2566afc84b3f5704dd7c999e21
Author: Martin Jambor <mjambor@suse.cz>
Date:   Wed Feb 1 18:58:09 2023 +0100

    ipa: Release body more carefully when removing nodes (PR 107944)

    The code removing function bodies when the last call graph clone of a
    node is removed is too aggressive when there are nodes up the
    clone_of chain which still need them.  Fixed by expanding the check.

    gcc/ChangeLog:

    2023-01-18  Martin Jambor  <mjambor@suse.cz>

            PR ipa/107944
            * cgraph.cc (cgraph_node::remove): Check whether nodes up the
            lcone_of chain also do not need the body.

    (cherry picked from commit db959e250077ae6b4fc08f53fb322719582c5de6)

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

* [Bug ipa/107944] [11/12/13 Regression] ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7
  2022-12-01  9:12 [Bug ipa/107944] New: ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7 marxin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-02-01 17:58 ` cvs-commit at gcc dot gnu.org
@ 2023-02-02 11:28 ` cvs-commit at gcc dot gnu.org
  2023-02-02 11:30 ` jamborm at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-02-02 11:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Martin Jambor
<jamborm@gcc.gnu.org>:

https://gcc.gnu.org/g:e36385be53d51539e1c295a80085115b24fede32

commit r11-10496-ge36385be53d51539e1c295a80085115b24fede32
Author: Martin Jambor <mjambor@suse.cz>
Date:   Thu Feb 2 12:22:22 2023 +0100

    ipa: Release body more carefully when removing nodes (PR 107944)

    The code removing function bodies when the last call graph clone of a
    node is removed is too aggressive when there are nodes up the
    clone_of chain which still need them.  Fixed by expanding the check.

    gcc/ChangeLog:

    2023-01-18  Martin Jambor  <mjambor@suse.cz>

            PR ipa/107944
            * cgraph.c (cgraph_node::remove): Check whether nodes up the
            lcone_of chain also do not need the body.

    (cherry picked from commit db959e250077ae6b4fc08f53fb322719582c5de6)

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

* [Bug ipa/107944] [11/12/13 Regression] ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7
  2022-12-01  9:12 [Bug ipa/107944] New: ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7 marxin at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-02-02 11:28 ` cvs-commit at gcc dot gnu.org
@ 2023-02-02 11:30 ` jamborm at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jamborm at gcc dot gnu.org @ 2023-02-02 11:30 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Should be fixed everywhere.

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

end of thread, other threads:[~2023-02-02 11:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01  9:12 [Bug ipa/107944] New: ICE in cgraph_node::get_untransformed_body since r13-48-g27ee75dbe81bb7 marxin at gcc dot gnu.org
2022-12-01  9:12 ` [Bug ipa/107944] " marxin at gcc dot gnu.org
2022-12-01  9:52 ` [Bug ipa/107944] [12/13 Regression] " rguenth at gcc dot gnu.org
2022-12-21 10:59 ` [Bug ipa/107944] [11/12/13 " rguenth at gcc dot gnu.org
2022-12-28  9:21 ` marxin at gcc dot gnu.org
2023-01-18 14:44 ` cvs-commit at gcc dot gnu.org
2023-02-01 17:58 ` cvs-commit at gcc dot gnu.org
2023-02-02 11:28 ` cvs-commit at gcc dot gnu.org
2023-02-02 11:30 ` jamborm 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).