Bug 97244 - [11 Regression] ICE in ipa_edge_args_sum_t::duplicate at gcc/ipa-prop.c:4251 since r11-3478-gada353b87909fd6c
Summary: [11 Regression] ICE in ipa_edge_args_sum_t::duplicate at gcc/ipa-prop.c:4251 ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ipa (show other bugs)
Version: 11.0
: P3 normal
Target Milestone: 11.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
: 97235 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-09-29 13:50 UTC by Martin Liška
Modified: 2020-10-01 13:20 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-09-29 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2020-09-29 13:50:29 UTC
The following fails:

$ gcc /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/ipa/remref-2a.c -O3 -fno-early-inlining -fno-ipa-modref
during IPA pass: inline
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/ipa/remref-2a.c: In function ‘main’:
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/ipa/remref-2a.c:81:7: internal compiler error: in duplicate, at ipa-prop.c:4251
   81 |       hip1_1 (hooray_1);
      |       ^~~~~~~~~~~~~~~~~
0x69433a ipa_edge_args_sum_t::duplicate(cgraph_edge*, cgraph_edge*, ipa_edge_args*, ipa_edge_args*)
	/home/marxin/Programming/gcc/gcc/ipa-prop.c:4251
0x96cc0b symbol_table::call_edge_duplication_hooks(cgraph_edge*, cgraph_edge*)
	/home/marxin/Programming/gcc/gcc/cgraph.c:451
0x9804fb cgraph_edge::clone(cgraph_node*, gcall*, unsigned int, profile_count, profile_count, bool)
	/home/marxin/Programming/gcc/gcc/cgraphclones.c:149
0xe25067 copy_bb
	/home/marxin/Programming/gcc/gcc/tree-inline.c:2266
0xe2602f copy_cfg_body
	/home/marxin/Programming/gcc/gcc/tree-inline.c:3042
0xe2602f copy_body
	/home/marxin/Programming/gcc/gcc/tree-inline.c:3290
0xe292c8 expand_call_inline
	/home/marxin/Programming/gcc/gcc/tree-inline.c:5076
0xe2ae89 gimple_expand_calls_inline
	/home/marxin/Programming/gcc/gcc/tree-inline.c:5266
0xe2ae89 optimize_inline_calls(tree_node*)
	/home/marxin/Programming/gcc/gcc/tree-inline.c:5439
0xb954e3 inline_transform(cgraph_node*)
	/home/marxin/Programming/gcc/gcc/ipa-inline-transform.c:741
0xcc98cd execute_one_ipa_transform_pass
	/home/marxin/Programming/gcc/gcc/passes.c:2240
0xcc98cd execute_all_ipa_transforms(bool)
	/home/marxin/Programming/gcc/gcc/passes.c:2279
0x97bca3 cgraph_node::expand()
	/home/marxin/Programming/gcc/gcc/cgraphunit.c:2302
0x97d24f expand_all_functions
	/home/marxin/Programming/gcc/gcc/cgraphunit.c:2480
0x97d24f symbol_table::compile()
	/home/marxin/Programming/gcc/gcc/cgraphunit.c:2843
0x97f642 symbol_table::compile()
	/home/marxin/Programming/gcc/gcc/cgraphunit.c:2756
0x97f642 symbol_table::finalize_compilation_unit()
	/home/marxin/Programming/gcc/gcc/cgraphunit.c:3021
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Comment 1 Iain Sandoe 2020-09-29 23:20:39 UTC
a stage #1 debug build using a recent GCC-11 with 
 make CFLAGS="-Og -g" CXXFLAGS="-Og -g"
 also fails in the same way on x86_64-linux and darwin:

I think between r11-3505....r11-3531.

during IPA pass: inline
../../src/gcc/cgraph.c: In member function ‘bool cgraph_node::can_remove_if_no_direct_calls_p(bool)’:
../../src/gcc/cgraph.c:2935:43: internal compiler error: in duplicate, at ipa-prop.c:4251
 2935 |       return !call_for_symbol_and_aliases (nonremovable_p, NULL, true);
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x7814c2 ipa_edge_args_sum_t::duplicate(cgraph_edge*, cgraph_edge*, ipa_edge_args*, ipa_edge_args*)
	../../src/gcc/ipa-prop.c:4251
0xe02ddb symbol_table::call_edge_duplication_hooks(cgraph_edge*, cgraph_edge*)
	../../src/gcc/cgraph.c:451
0xe1657b cgraph_edge::clone(cgraph_node*, gcall*, unsigned int, profile_count, profile_count, bool)
	../../src/gcc/cgraphclones.c:149
0x12edcb7 copy_bb
	../../src/gcc/tree-inline.c:2266
0x12eecc3 copy_cfg_body
	../../src/gcc/tree-inline.c:3042
0x12eecc3 copy_body
	../../src/gcc/tree-inline.c:3290
0x12f1fa8 expand_call_inline
	../../src/gcc/tree-inline.c:5076
0x12f3b31 gimple_expand_calls_inline
	../../src/gcc/tree-inline.c:5266
0x12f3b31 optimize_inline_calls(tree_node*)
	../../src/gcc/tree-inline.c:5439
0x103cb8b inline_transform(cgraph_node*)
	../../src/gcc/ipa-inline-transform.c:741
0x117d0cd execute_one_ipa_transform_pass
	../../src/gcc/passes.c:2240
0x117d0cd execute_all_ipa_transforms(bool)
	../../src/gcc/passes.c:2279
0xe11d13 cgraph_node::expand()
	../../src/gcc/cgraphunit.c:2302
0xe132af expand_all_functions
	../../src/gcc/cgraphunit.c:2480
0xe132af symbol_table::compile()
	../../src/gcc/cgraphunit.c:2843
0xe156e2 symbol_table::compile()
	../../src/gcc/cgraphunit.c:2756
0xe156e2 symbol_table::finalize_compilation_unit()
	../../src/gcc/cgraphunit.c:3021
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make[1]: *** [Makefile:1123: cgraph.o] Error 1
make: *** [Makefile:4726: all-gcc] Error 2
Comment 2 GCC Commits 2020-10-01 13:03:41 UTC
The master branch has been updated by Jan Hubicka <hubicka@gcc.gnu.org>:

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

commit r11-3589-gbc2fcccd9d5cc9d346543a98c98dc00d71e9a5b8
Author: Jan Hubicka <jh@suse.cz>
Date:   Thu Oct 1 15:03:19 2020 +0200

    Fix ICE in ipa_edge_args_sum_t::duplicate
    
            PR ipa/97244
            * ipa-fnsummary.c (pass_free_fnsummary::execute): Free
            also indirect inlining datastructure.
            * ipa-modref.c (pass_ipa_modref::execute): Do not free them here.
            * ipa-prop.c (ipa_free_all_node_params): Do not crash when info does
            not exist.
            (ipa_unregister_cgraph_hooks): Likewise.
Comment 3 GCC Commits 2020-10-01 13:04:19 UTC
The master branch has been updated by Jan Hubicka <hubicka@gcc.gnu.org>:

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

commit r11-3590-ga12041339e8032f40acd5f1c0365f5b3a1469bf5
Author: Jan Hubicka <jh@suse.cz>
Date:   Thu Oct 1 15:03:45 2020 +0200

    Add -fno-ipa-modref to gcc.dg/ipa/remref-2a.c
    
            PR ipa/97244
            * gcc.dg/ipa/remref-2a.c: Add -fno-ipa-modref
Comment 4 Jan Hubicka 2020-10-01 13:14:49 UTC
*** Bug 97235 has been marked as a duplicate of this bug. ***
Comment 5 Jan Hubicka 2020-10-01 13:20:27 UTC
Fixed.