public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/96394] New: internal compiler error: in add_new_edges_to_heap, at ipa-inline.c:1746 (-O3 PGO)
@ 2020-07-30 22:39 slyfox at gcc dot gnu.org
  2020-07-30 22:43 ` [Bug ipa/96394] " slyfox at gcc dot gnu.org
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: slyfox at gcc dot gnu.org @ 2020-07-30 22:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96394
           Summary: internal compiler error: in add_new_edges_to_heap, at
                    ipa-inline.c:1746 (-O3 PGO)
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

It's a forward of https://bugs.gentoo.org/734006 where Ștefan Talpalaru found
an ICE when gcc tries to build PGO-optimised variant of python tauthon-2.8.2.

I can consistently reproduce the crash on gcc-10.2.0 and was able to extract
the backtrace from -O0 ggdb3 gcc:

$ ${HOME}/dev/git/gcc-10-build/gcc/xgcc -B${HOME}/dev/git/gcc-10-build/gcc 
-pthread -fPIC -fno-strict-aliasing -O3 -frecord-gcc-switches -fwrapv -DNDEBUG
-fprofile-use -fprofile-correction -I.
-I/tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Include
-I/tmp/portage/dev-lang/tauthon-2.8.2/work/x86_64-pc-linux-gnu -c
/tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Modules/parsermodule.c
-o
build/temp.linux-x86_64-2.8/tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Modules/parsermodule.o
-v -fdump-ipa-all-slim

Breakpoint 2, internal_error (gmsgid=0x297d49f "in %s, at %s:%d") at
../../gcc-10/gcc/diagnostic.c:1706
1706    {
(gdb) bt
#0  internal_error (gmsgid=0x297d49f "in %s, at %s:%d") at
../../gcc-10/gcc/diagnostic.c:1706
#1  0x0000000002063d64 in fancy_abort (file=0x2912678
"../../gcc-10/gcc/ipa-inline.c", line=1746, function=0x2912cd4
"add_new_edges_to_heap") at ../../gcc-10/gcc/diagnostic.c:1778
#2  0x0000000001f3fb12 in add_new_edges_to_heap (heap=0x7fffffffce90,
new_edges=...) at ../../gcc-10/gcc/ipa-inline.c:1746
#3  0x0000000001f412e0 in inline_small_functions () at
../../gcc-10/gcc/ipa-inline.c:2210
#4  0x0000000001f43074 in ipa_inline () at ../../gcc-10/gcc/ipa-inline.c:2689
#5  0x0000000001f43eb1 in (anonymous namespace)::pass_ipa_inline::execute
(this=0x2f03ce0) at ../../gcc-10/gcc/ipa-inline.c:3091
#6  0x0000000000fd326c in execute_one_pass (pass=0x2f03ce0) at
../../gcc-10/gcc/passes.c:2502
#7  0x0000000000fd41c9 in execute_ipa_pass_list (pass=0x2f03ce0) at
../../gcc-10/gcc/passes.c:2929
#8  0x0000000000adbb78 in ipa_passes () at ../../gcc-10/gcc/cgraphunit.c:2678
#9  0x0000000000adbd95 in symbol_table::compile (this=0x7ffff7865100) at
../../gcc-10/gcc/cgraphunit.c:2755
#10 0x0000000000adc33d in symbol_table::finalize_compilation_unit
(this=0x7ffff7865100) at ../../gcc-10/gcc/cgraphunit.c:3002
#11 0x00000000011332a9 in compile_file () at ../../gcc-10/gcc/toplev.c:483
#12 0x00000000011364aa in do_compile () at ../../gcc-10/gcc/toplev.c:2298
#13 0x00000000011367b6 in toplev::main (this=0x7fffffffd266, argc=37,
argv=0x7fffffffd378) at ../../gcc-10/gcc/toplev.c:2437
#14 0x0000000002035d42 in main (argc=37, argv=0x7fffffffd378) at
../../gcc-10/gcc/main.c:39
(gdb) fr 2
#2  0x0000000001f3fb12 in add_new_edges_to_heap (heap=0x7fffffffce90,
new_edges=...) at ../../gcc-10/gcc/ipa-inline.c:1746
1746          gcc_assert (!edge->aux);
(gdb) list
1741    {
1742      while (new_edges.length () > 0)
1743        {
1744          struct cgraph_edge *edge = new_edges.pop ();
1745
1746          gcc_assert (!edge->aux);
1747          gcc_assert (edge->callee);
1748          if (edge->inline_failed
1749              && can_inline_edge_p (edge, true)
1750              && want_inline_small_function_p (edge, true)

Dumping the edge: validate_chain_two_ops/133 -> validate_arith_expr/135

(gdb) call edge->caller->dump(stdout)
validate_chain_two_ops/133 (validate_chain_two_ops) @0x7ffff6efc708
  Type: function definition analyzed
  Visibility: prevailing_def_ironly
  previous sharing asm name: 430
  References: parser_error/46 (read)
  Referring:
  Function validate_chain_two_ops/133 is inline copy in validate_shift_expr/134
  Availability: local
  Profile id: 607042219
  Function flags: count:395 (estimated locally, globally 0) first_run:27 body
local unlikely_executed
  Called by: validate_shift_expr/134 (inlined) (395 (estimated locally,
globally 0),1.00 per call)
  Calls: validate_arith_expr/135 (indirect_inlining) (9 (estimated locally,
globally 0 adjusted),0.02 per call) validate_arith_expr/135 (indirect_inlining)
(394 (estimated locally, globally 0 adjusted),1.00 per call) PyErr_Format/202
(0 (precise),0.00 per call)

(gdb) call edge->callee->dump(stdout)
validate_arith_expr/135 (validate_arith_expr) @0x7ffff6efc9d8
  Type: function definition analyzed
  Visibility: prevailing_def_ironly
  previous sharing asm name: 435
  Address is taken.
  References: parser_error/46 (read)
  Referring:
  Availability: available
  Profile id: 829576279
  Function flags: count:1 (adjusted) first_run:28 body hot
  Called by: validate_chain_two_ops/133 (indirect_inlining) (9 (estimated
locally, globally 0 adjusted),0.02 per call) validate_chain_two_ops/491
(indirect_inlining) (9 (adjusted),0.02 per call) validate_chain_two_ops/431
(indirect_inlining) (9 (estimated locally, globally 0 adjusted),0.02 per call)
validate_chain_two_ops/133 (indirect_inlining) (394 (estimated locally,
globally 0 adjusted),1.00 per call) validate_node/162 (0 (precise),0.00 per
call)
  Calls: PyErr_Format/202 (0 (precise),0.00 per call)
validate_chain_two_ops/430 (inlined) (1 (adjusted),1.00 per call)

If I understand the assert correctly edge was added twice in the heap (or
similar?).

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

end of thread, other threads:[~2020-10-16 10:20 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30 22:39 [Bug ipa/96394] New: internal compiler error: in add_new_edges_to_heap, at ipa-inline.c:1746 (-O3 PGO) slyfox at gcc dot gnu.org
2020-07-30 22:43 ` [Bug ipa/96394] " slyfox at gcc dot gnu.org
2020-07-30 22:48 ` slyfox at gcc dot gnu.org
2020-07-30 23:09 ` slyfox at gcc dot gnu.org
2020-07-31  6:20 ` marxin at gcc dot gnu.org
2020-07-31  6:21 ` marxin at gcc dot gnu.org
2020-07-31  6:52 ` marxin at gcc dot gnu.org
2020-07-31 12:11 ` marxin at gcc dot gnu.org
2020-09-06 11:35 ` [Bug ipa/96394] [10/11 Regression] ICE " slyfox at gcc dot gnu.org
2020-09-06 21:21 ` slyfox at gcc dot gnu.org
2020-09-23 21:58 ` slyfox at gcc dot gnu.org
2020-09-23 21:59 ` slyfox at gcc dot gnu.org
2020-09-23 22:04 ` slyfox at gcc dot gnu.org
2020-09-24 10:31 ` marxin at gcc dot gnu.org
2020-09-25 14:15 ` jamborm at gcc dot gnu.org
2020-09-25 15:46 ` jamborm at gcc dot gnu.org
2020-09-29  7:41 ` marxin at gcc dot gnu.org
2020-09-29  7:41 ` marxin at gcc dot gnu.org
2020-10-01 17:41 ` jamborm at gcc dot gnu.org
2020-10-01 18:42 ` marxin at gcc dot gnu.org
2020-10-02 23:02 ` slyfox at gcc dot gnu.org
2020-10-07 12:35 ` cvs-commit at gcc dot gnu.org
2020-10-16 10:16 ` cvs-commit at gcc dot gnu.org
2020-10-16 10:20 ` 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).