public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/108511] New: [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184
@ 2023-01-24  8:36 ro at gcc dot gnu.org
  2023-01-24  8:36 ` [Bug ipa/108511] " ro at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ro at gcc dot gnu.org @ 2023-01-24  8:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108511
           Summary: [13 regression] ICE in
                    possibly_call_in_translation_unit_p, at cgraph.cc:4184
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---
              Host: *-*-solaris2.11
            Target: *-*-solaris2.11
             Build: *-*-solaris2.11

Between 20230120 (99ea0d7611605d2d1a67a6021cb78f0bdd5c609b) and 20230123
(b457cab64038cd9b7a8481594ff673f1822681f6),
a lto test regressed on Solaris (both sparc and x86, 32 and 64-bit):

+FAIL: g++.dg/lto/pr88049 cp_lto_pr88049_0.o-cp_lto_pr88049_0.o link,  -flto
-O2 -w  (internal compiler error: in possibly_call_in_translation_unit_p, at
cgraph.cc:4184)

during IPA pass: fnsummary
lto1: internal compiler error: in possibly_call_in_translation_unit_p, at
cgraph.cc:4184
0x8c9a54d cgraph_edge::possibly_call_in_translation_unit_p()
        /vol/gcc/src/hg/master/local/gcc/cgraph.cc:4184
0x8f6c80d ipa_read_edge_info
        /vol/gcc/src/hg/master/local/gcc/ipa-prop.cc:5083
0x8f6cdc7 ipa_read_node_info
        /vol/gcc/src/hg/master/local/gcc/ipa-prop.cc:5168
0x8f6cdc7 ipa_prop_read_section
        /vol/gcc/src/hg/master/local/gcc/ipa-prop.cc:5251
0x8f6cdc7 ipa_prop_read_jump_functions()
        /vol/gcc/src/hg/master/local/gcc/ipa-prop.cc:5278
0x8f230c2 ipa_fn_summary_read
        /vol/gcc/src/hg/master/local/gcc/ipa-fnsummary.cc:4638
0x90cb1cc ipa_read_summaries_1
        /vol/gcc/src/hg/master/local/gcc/passes.cc:3001
0x8bf1eb4 read_cgraph_and_symbols(unsigned int, char const**)
        /vol/gcc/src/hg/master/local/gcc/lto/lto-common.cc:2936
0x8bd5825 lto_main()
        /vol/gcc/src/hg/master/local/gcc/lto/lto.cc:654

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

* [Bug ipa/108511] [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184
  2023-01-24  8:36 [Bug ipa/108511] New: [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 ro at gcc dot gnu.org
@ 2023-01-24  8:36 ` ro at gcc dot gnu.org
  2023-01-25  9:19 ` [Bug ipa/108511] [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 since r13-5285-g106f99406312d7ed marxin at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ro at gcc dot gnu.org @ 2023-01-24  8:36 UTC (permalink / raw)
  To: gcc-bugs

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

Rainer Orth <ro at gcc dot gnu.org> changed:

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

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

* [Bug ipa/108511] [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 since r13-5285-g106f99406312d7ed
  2023-01-24  8:36 [Bug ipa/108511] New: [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 ro at gcc dot gnu.org
  2023-01-24  8:36 ` [Bug ipa/108511] " ro at gcc dot gnu.org
@ 2023-01-25  9:19 ` marxin at gcc dot gnu.org
  2023-01-25  9:20 ` marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-01-25  9:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org
            Summary|[13 regression] ICE in      |[13 regression] ICE in
                   |possibly_call_in_translatio |possibly_call_in_translatio
                   |n_unit_p, at cgraph.cc:4184 |n_unit_p, at cgraph.cc:4184
                   |                            |since
                   |                            |r13-5285-g106f99406312d7ed

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
I see the same crash on Linux, started with r13-5285-g106f99406312d7ed.

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

* [Bug ipa/108511] [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 since r13-5285-g106f99406312d7ed
  2023-01-24  8:36 [Bug ipa/108511] New: [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 ro at gcc dot gnu.org
  2023-01-24  8:36 ` [Bug ipa/108511] " ro at gcc dot gnu.org
  2023-01-25  9:19 ` [Bug ipa/108511] [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 since r13-5285-g106f99406312d7ed marxin at gcc dot gnu.org
@ 2023-01-25  9:20 ` marxin at gcc dot gnu.org
  2023-01-25 10:02 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-01-25  9:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-01-25

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
The problematic symbol is:

Breakpoint 1, cgraph_edge::possibly_call_in_translation_unit_p
(this=0x7ffff7629270) at /home/marxin/Programming/gcc/gcc/cgraph.cc:4159
4159      gcc_checking_assert (in_lto_p && caller->prevailing_p ());
(gdb) p node->debug()
_ZN1aIN12_GLOBAL__N_11fEED1Ev/5 (__dt_comp )
  Type: function
  Visibility: semantic_interposition external virtual
  References: 
  Referring: 
  Read from file: a-pr88049_0.o
  Unit id: 1
  Function flags:
  Called by: _Z41__static_initialization_and_destruction_0v/2 
  Calls: 

(gdb) p debug_tree(node->decl)
 <function_decl 0x7ffff747db00 __dt_comp 
    type <method_type 0x7ffff747be70
        type <void_type 0x7ffff763af18 void VOID
            align:8 warn_if_not_align:0 symtab:0 alias-set -1
structural-equality
            pointer_to_this <pointer_type 0x7ffff7642000>>
        QI
        size <integer_cst 0x7ffff7620d38 constant 8>
        unit-size <integer_cst 0x7ffff7620d50 constant 1>
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 structural-equality
method basetype <record_type 0x7ffff747bbd0 a>
        arg-types <tree_list 0x7ffff747aed8 value <pointer_type 0x7ffff747bd20>
            chain <tree_list 0x7ffff7639de8 value <void_type 0x7ffff763af18
void>>>
        pointer_to_this <pointer_type 0x7ffff747b3f0>>
    addressable external virtual QI
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/lto/pr88049_0.C:12:11
align:16 warn_if_not_align:0 context <record_type 0x7ffff747bbd0 a>>
$2 = void

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

* [Bug ipa/108511] [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 since r13-5285-g106f99406312d7ed
  2023-01-24  8:36 [Bug ipa/108511] New: [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 ro at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-01-25  9:20 ` marxin at gcc dot gnu.org
@ 2023-01-25 10:02 ` rguenth at gcc dot gnu.org
  2023-01-25 10:30 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-25 10:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm,

make check-g++ RUNTESTFLAGS="--target_board=unix/\{,-m32\} lto.exp=pr88049_0.C"

works just fine for me?

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

* [Bug ipa/108511] [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 since r13-5285-g106f99406312d7ed
  2023-01-24  8:36 [Bug ipa/108511] New: [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 ro at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-01-25 10:02 ` rguenth at gcc dot gnu.org
@ 2023-01-25 10:30 ` marxin at gcc dot gnu.org
  2023-01-25 12:07 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-01-25 10:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Yeah, the test is normally run with -r argument, so just run it with;

g++ /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/lto/pr88049_0.C -flto
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/lto/pr88049_0.C:12:11:
warning: ‘a< <template-parameter-1-1> >::~a() noexcept [with
<template-parameter-1-1> = {anonymous}::f]’ used but never defined
   12 |   virtual ~a();
      |           ^
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/lto/pr88049_0.C:9:28:
warning: ‘a<e> d(char) [with e = {anonymous}::f]’ used but never defined
    9 | template <typename e> a<e> d(char);
      |                            ^
during IPA pass: fnsummary
lto1: internal compiler error: in possibly_call_in_translation_unit_p, at
cgraph.cc:4184
0x6aa523 cgraph_edge::possibly_call_in_translation_unit_p()
        /home/marxin/Programming/gcc/gcc/cgraph.cc:4184
0xb65ad0 read_ipa_call_summary
        /home/marxin/Programming/gcc/gcc/ipa-fnsummary.cc:4406
0xb69a1f inline_read_section
        /home/marxin/Programming/gcc/gcc/ipa-fnsummary.cc:4616
0xb69e98 ipa_fn_summary_read
        /home/marxin/Programming/gcc/gcc/ipa-fnsummary.cc:4648
0xcedcf6 ipa_read_summaries_1
        /home/marxin/Programming/gcc/gcc/passes.cc:3001
0x8ae4e4 read_cgraph_and_symbols(unsigned int, char const**)
        /home/marxin/Programming/gcc/gcc/lto/lto-common.cc:2936
0x894892 lto_main()
        /home/marxin/Programming/gcc/gcc/lto/lto.cc:654
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.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

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

* [Bug ipa/108511] [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 since r13-5285-g106f99406312d7ed
  2023-01-24  8:36 [Bug ipa/108511] New: [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 ro at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-01-25 10:30 ` marxin at gcc dot gnu.org
@ 2023-01-25 12:07 ` rguenth at gcc dot gnu.org
  2023-01-25 12:08 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-25 12:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
I don't know what the assert really wants to check but

  /* If callee is local to the original translation unit, it will be
     defined.  */
  if (!TREE_PUBLIC (callee->decl) && !DECL_EXTERNAL (callee->decl))
    return true;

is now possibly "wrong".  The cases I changed are DECL_EXTERNAL && !TREE_PUBLIC
to no longer make them TREE_PUBLIC (not sure why the FE sets DECL_EXTERNAL,
possibly because it's a declaration).  But "local to the original TU" should
be just !TREE_PUBLIC, no?

Anyway, I can't make real sense of what the function should do, my
understanding of the comment doesn't match up with the code ...

Honza?

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

* [Bug ipa/108511] [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 since r13-5285-g106f99406312d7ed
  2023-01-24  8:36 [Bug ipa/108511] New: [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 ro at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-01-25 12:07 ` rguenth at gcc dot gnu.org
@ 2023-01-25 12:08 ` rguenth at gcc dot gnu.org
  2023-01-29  0:01 ` hubicka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-25 12:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

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

* [Bug ipa/108511] [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 since r13-5285-g106f99406312d7ed
  2023-01-24  8:36 [Bug ipa/108511] New: [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 ro at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-01-25 12:08 ` rguenth at gcc dot gnu.org
@ 2023-01-29  0:01 ` hubicka at gcc dot gnu.org
  2023-01-30  8:35 ` cvs-commit at gcc dot gnu.org
  2023-01-30  8:35 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: hubicka at gcc dot gnu.org @ 2023-01-29  0:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
The function is used to discard early summaries that will lead to external
calls. This saves some memory allocations.

At this stage we have identified prevailing symbols and they are first in the
next_sharing_asm_name lists.  So the code looks it up and it ices because there
is an external reference from one unit while previaling symbol is not public.
It happens with -r only since there we do not have resolution info.

Relaxing the assert to TREE_PUBLIC || DECL_EXTERNAL is safe and I guess easiest
way to get around.

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

* [Bug ipa/108511] [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 since r13-5285-g106f99406312d7ed
  2023-01-24  8:36 [Bug ipa/108511] New: [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 ro at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-01-29  0:01 ` hubicka at gcc dot gnu.org
@ 2023-01-30  8:35 ` cvs-commit at gcc dot gnu.org
  2023-01-30  8:35 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-30  8:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:4c17371dc5a1193671e5a475349fa7d7a6f0ca1c

commit r13-5489-g4c17371dc5a1193671e5a475349fa7d7a6f0ca1c
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Jan 30 08:20:03 2023 +0100

    ipa/108511 - relax assert for undefined local statics

    Since we no longer promote undefined local statics extern the
    assert in possibly_call_in_translation_unit_p triggers.  The
    following relaxes it according to Honzas advice.

            PR ipa/108511
            * cgraph.cc (possibly_call_in_translation_unit_p): Relax
            assert.

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

* [Bug ipa/108511] [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 since r13-5285-g106f99406312d7ed
  2023-01-24  8:36 [Bug ipa/108511] New: [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 ro at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-01-30  8:35 ` cvs-commit at gcc dot gnu.org
@ 2023-01-30  8:35 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-30  8:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Should be fixed.

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

end of thread, other threads:[~2023-01-30  8:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-24  8:36 [Bug ipa/108511] New: [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 ro at gcc dot gnu.org
2023-01-24  8:36 ` [Bug ipa/108511] " ro at gcc dot gnu.org
2023-01-25  9:19 ` [Bug ipa/108511] [13 regression] ICE in possibly_call_in_translation_unit_p, at cgraph.cc:4184 since r13-5285-g106f99406312d7ed marxin at gcc dot gnu.org
2023-01-25  9:20 ` marxin at gcc dot gnu.org
2023-01-25 10:02 ` rguenth at gcc dot gnu.org
2023-01-25 10:30 ` marxin at gcc dot gnu.org
2023-01-25 12:07 ` rguenth at gcc dot gnu.org
2023-01-25 12:08 ` rguenth at gcc dot gnu.org
2023-01-29  0:01 ` hubicka at gcc dot gnu.org
2023-01-30  8:35 ` cvs-commit at gcc dot gnu.org
2023-01-30  8:35 ` rguenth 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).