https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84105
Bug ID: 84105 Summary: [8 regression] Segmentation fault in pp_tree_identifier() during LTO Product: gcc Version: 8.0.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: arnd at linaro dot org CC: marxin at gcc dot gnu.org Target Milestone: --- I got an ICE while building the linux kernel module net/sctp/sctp.ko with i386-linux-gcc-8.0.1, currently using r257114. A slightly older gcc-8.0.0 (dated 20180107, exact revision unknown) doesn't have this problem. /bin/bash /git/arm-soc/scripts/gcc-ld -fuse-linker-plugin -flto=jobserver -flto -fno-strict-aliasing -fno-fat-lto-objects -Wno-attribute-alias -fwhole-program -fno-strict-aliasing -fdump-ipa-cgraph -fdump-ipa-inline-details -fipa-cp-clone -r -m elf_i386 -T /git/arm-soc/scripts/module-common.lds --build-id -o net/sctp/sctp.ko net/sctp/sctp.o net/sctp/sctp.mod.o ; true during IPA pass: inline dump file: net/sctp/sctp.ko.ltrans0.079i.inline /git/arm-soc/net/sctp/sm_sideeffect.c: In function 'sctp_do_sm': /git/arm-soc/net/sctp/sm_sideeffect.c:1155:5: internal compiler error: Segmentation fault int sctp_do_sm(struct net *net, enum sctp_event event_type, ^ 0xa42b7f crash_signal /home/arnd/git/gcc/gcc/toplev.c:325 0xaf0659 pp_tree_identifier(pretty_printer*, tree_node*) /home/arnd/git/gcc/gcc/tree-pretty-print.c:4006 0xaf0966 dump_decl_name /home/arnd/git/gcc/gcc/tree-pretty-print.c:261 0xaf42ea dump_generic_node(pretty_printer*, tree_node*, int, unsigned long, bool) /home/arnd/git/gcc/gcc/tree-pretty-print.c:1826 0xaf769a print_declaration(pretty_printer*, tree_node*, int, unsigned long) /home/arnd/git/gcc/gcc/tree-pretty-print.c:3333 0xaf7997 print_generic_decl(_IO_FILE*, tree_node*, unsigned long) /home/arnd/git/gcc/gcc/tree-pretty-print.c:122 0xb4603a dump_scope_block /home/arnd/git/gcc/gcc/tree-ssa-live.c:647 0xb471b9 dump_scope_blocks(_IO_FILE*, unsigned long) /home/arnd/git/gcc/gcc/tree-ssa-live.c:678 0xb471b9 remove_unused_locals() /home/arnd/git/gcc/gcc/tree-ssa-live.c:870 0x97af44 execute_function_todo /home/arnd/git/gcc/gcc/passes.c:1972 0x97b8b9 execute_todo /home/arnd/git/gcc/gcc/passes.c:2048 0x97dac5 execute_one_ipa_transform_pass /home/arnd/git/gcc/gcc/passes.c:2245 0x97dac5 execute_all_ipa_transforms() /home/arnd/git/gcc/gcc/passes.c:2281 0x6d681c cgraph_node::expand() /home/arnd/git/gcc/gcc/cgraphunit.c:2132 0x6d7b38 expand_all_functions /home/arnd/git/gcc/gcc/cgraphunit.c:2275 0x6d7b38 symbol_table::compile() /home/arnd/git/gcc/gcc/cgraphunit.c:2624 0x656c51 lto_main() /home/arnd/git/gcc/gcc/lto/lto.c:3349 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. I have not been able to create a simple test case for it, but can provide steps for reproducing, or help test patches. If necessary, I can do a bisection, but maybe someone can see from the backtrace what is happening, or has a duplicate bugreport. >From what I can tell, the ICE is caused by a typedef inside of a function, moving the typedef outside of the function avoids the problem. See the source code at: https://elixir.free-electrons.com/linux/v4.15/source/net/sctp/sm_sideeffect.c#L1172