https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110510
Bug ID: 110510 Summary: ggc infinite recursion Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: franckbehaghel_gcc at protonmail dot com Target Milestone: --- Created attachment 55444 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55444&action=edit source Hello, The attached ada source file fails to build. I got the following result: $ gcc -c failed_ggc.adb failed_ggc.adb:3:11: warning: file name does not match unit name, should be "main.adb" [enabled by default] raised STORAGE_ERROR : stack overflow or erroneous memory access Looking into this with gdb, it gaves me more detailed information : $ gcc -c -wrapper gdb,--args failed_ggc.adb [...] Program received signal SIGSEGV, Segmentation fault. 0x00000000010592c3 in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0410) at gtype-desc.cc:3582 3582 gt_ggc_m_7rtx_def ((*x).landing_pad); [...] backtrace output looks like a infinite recursion : (gdb) bt #0 0x00000000010592c3 in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0410) at gtype-desc.cc:3582 #1 gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0438) at gtype-desc.cc:3579 #2 0x00000000010592d4 in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0438) at gtype-desc.cc:3582 #3 gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0460) at gtype-desc.cc:3579 #4 0x00000000010592d4 in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0460) at gtype-desc.cc:3582 #5 gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0488) at gtype-desc.cc:3579 #6 0x00000000010592d4 in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0488) at gtype-desc.cc:3582 #7 gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e04b0) at gtype-desc.cc:3579 #8 0x00000000010592d4 in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e04b0) at gtype-desc.cc:3582 #9 gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e04d8) at gtype-desc.cc:3579 #10 0x00000000010592d4 in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e04d8) at gtype-desc.cc:3582 #11 gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0500) at gtype-desc.cc:3579 #12 0x00000000010592d4 in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0500) at gtype-desc.cc:3582 #13 gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0528) at gtype-desc.cc:3579 #14 0x00000000010592d4 in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0528) at gtype-desc.cc:3582 #15 gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0550) at gtype-desc.cc:3579 #16 0x00000000010592d4 in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0550) at gtype-desc.cc:3582 #17 gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0578) at gtype-desc.cc:3579 #18 0x00000000010592d4 in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e0578) at gtype-desc.cc:3582 #19 gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e05a0) at gtype-desc.cc:3579 #20 0x00000000010592d4 in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e05a0) at gtype-desc.cc:3582 #21 gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffd26e05c8) at gtype-desc.cc:3579 (gdb) bt -50 #4193802 0x00000000010592d4 in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffca638c80) at gtype-desc.cc:3582 #4193803 gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffca638ca8) at gtype-desc.cc:3579 #4193804 0x00000000010592d4 in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffca638ca8) at gtype-desc.cc:3582 #4193805 gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffca638cd0) at gtype-desc.cc:3579 #4193806 0x00000000010592d4 in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffca638cd0) at gtype-desc.cc:3582 #4193807 gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffca638cf8) at gtype-desc.cc:3579 #4193808 0x000000000105939c in gt_ggc_mx_eh_landing_pad_d (x_p=0x7fffca638cf8) at gtype-desc.cc:3577 #4193809 gt_ggc_mx_eh_region_d (x_p=0x7fffd9141738) at gtype-desc.cc:3567 #4193810 0x00000000010593f0 in gt_ggc_mx_eh_region_d (x_p=0x7fffd9141738) at gtype-desc.cc:3562 #4193811 gt_ggc_mx_eh_region_d (x_p=0x7fffd91416e0) at gtype-desc.cc:3549 #4193812 0x000000000105a0d0 in gt_ggc_mx_eh_region_d (x_p=0x7fffd91416e0) at gtype-desc.cc:3614 #4193813 gt_ggc_mx_eh_status (x_p=0x7fffea7522d0) at gtype-desc.cc:2259 #4193814 0x000000000105cefe in gt_ggc_mx_function (x_p=0x7fffe94610b8) at gtype-desc.cc:1720 #4193815 gt_ggc_mx_function (x_p=0x7fffe94610b8) at gtype-desc.cc:1715 #4193816 0x0000000000a1fc2a in gt_ggc_mx_lang_tree_node (x_p=<optimized out>) at ./gtype-ada.h:288 #4193817 0x0000000000a1fb87 in gt_ggc_mx_lang_tree_node (x_p=<optimized out>) at ./gtype-ada.h:277 #4193818 0x0000000000a1f158 in gt_ggc_mx_lang_tree_node (x_p=<optimized out>) at ./gtype-ada.h:191 #4193819 0x0000000000a1f5be in gt_ggc_mx_lang_tree_node (x_p=<optimized out>) at ./gtype-ada.h:420 #4193820 0x0000000001059cdf in gt_ggc_mx_gimple (x_p=<optimized out>) at gtype-desc.cc:1254 #4193821 0x000000000105afba in gt_ggc_mx_cgraph_edge (x_p=<optimized out>) at gtype-desc.cc:1422 #4193822 0x000000000105af9e in gt_ggc_mx_cgraph_edge (x_p=<optimized out>) at gtype-desc.cc:1420 #4193823 0x000000000105af9e in gt_ggc_mx_cgraph_edge (x_p=<optimized out>) at gtype-desc.cc:1420 #4193824 0x000000000105af9e in gt_ggc_mx_cgraph_edge (x_p=<optimized out>) at gtype-desc.cc:1420 #4193825 0x000000000105af9e in gt_ggc_mx_cgraph_edge (x_p=<optimized out>) at gtype-desc.cc:1420 #4193826 0x000000000105af9e in gt_ggc_mx_cgraph_edge (x_p=<optimized out>) at gtype-desc.cc:1420 #4193827 0x000000000105af9e in gt_ggc_mx_cgraph_edge (x_p=<optimized out>) at gtype-desc.cc:1420 #4193828 0x000000000105ade7 in gt_ggc_mx_symtab_node (x_p=<optimized out>) at gtype-desc.cc:1368 #4193829 0x0000000000a1f1dd in gt_ggc_mx_lang_tree_node (x_p=<optimized out>) at ./gtype-ada.h:200 #4193830 0x0000000001057d1a in gt_ggc_mx_rtx_def (x_p=<optimized out>) at gtype-desc.cc:732 #4193831 0x0000000001059724 in gt_ggc_mx (x=@0x7fffd57c66b8: 0x7fffdaab8810) at gtype-desc.cc:1701 #4193832 gt_ggc_mx<rtx_def*> (v=<optimized out>) at /DATA/git/gcc/gcc/gcc/vec.h:1370 #4193833 gt_ggc_mx_vec_rtx_va_gc_ (x_p=0x7fffd57c6000) at gtype-desc.cc:1693 #4193834 gt_ggc_mx_vec_rtx_va_gc_ (x_p=0x7fffd57c6000) at gtype-desc.cc:1688 #4193835 0x0000000000fca426 in ggc_mark_root_tab (rt=<optimized out>) at /DATA/git/gcc/gcc/gcc/ggc-common.cc:75 #4193836 0x0000000000fca75d in ggc_mark_roots () at /DATA/git/gcc/gcc/gcc/ggc-common.cc:92 #4193837 0x0000000000decd62 in ggc_collect (mode=GGC_COLLECT_HEURISTIC) at /DATA/git/gcc/gcc/gcc/ggc-page.cc:2227 #4193838 0x000000000121d947 in execute_one_pass (pass=0x367f170) at /DATA/git/gcc/gcc/gcc/passes.cc:2743 #4193839 0x000000000121da70 in execute_pass_list_1 (pass=0x367f170) at /DATA/git/gcc/gcc/gcc/passes.cc:2760 #4193840 0x000000000121da82 in execute_pass_list_1 (pass=0x367de90) at /DATA/git/gcc/gcc/gcc/passes.cc:2761 #4193841 0x000000000121daa9 in execute_pass_list (fn=0x7fffe94610b8, pass=<optimized out>) at /DATA/git/gcc/gcc/gcc/passes.cc:2771 #4193842 0x0000000000e78d86 in cgraph_node::expand (this=0x7fffdf8b3990) at /DATA/git/gcc/gcc/gcc/context.h:48 #4193843 cgraph_node::expand (this=0x7fffdf8b3990) at /DATA/git/gcc/gcc/gcc/cgraphunit.cc:1794 #4193844 0x0000000000e79f0a in output_in_order () at /DATA/git/gcc/gcc/gcc/cgraphunit.cc:2191 #4193845 symbol_table::compile (this=0x7fffea68d000) at /DATA/git/gcc/gcc/gcc/cgraphunit.cc:2395 #4193846 0x0000000000e7cb58 in symbol_table::compile (this=<error reading variable: dwarf2_find_location_expression: Corrupted DWARF expression.>) at /DATA/git/gcc/gcc/gcc/cgraphunit.cc:2583 #4193847 symbol_table::finalize_compilation_unit (this=0x7fffea68d000) at /DATA/git/gcc/gcc/gcc/cgraphunit.cc:2583 #4193848 0x0000000001323ce2 in compile_file () at /DATA/git/gcc/gcc/gcc/toplev.cc:471 #4193849 0x00000000009d20ca in do_compile (no_backend=false) at /DATA/git/gcc/gcc/gcc/toplev.cc:2126 Version 13.1 is fine. Version 14 until b106f11dc6adb8df15cc5c268896d314c76ca35f "c++: Accept elaborated-enum-base with pedwarn" is fine. Version 14 starting from 154c69039571c66b3a6d16ecfa9e6ff22942f59f "RA: Ignore conflicts for some pseudos from insns throwing a final exception" are affected by this crash. Compiler Explorer on trunk is affected too. (https://godbolt.org/) gcc -c -I/app/ -g -fdiagnostics-color=always -S -fverbose-asm -masm=intel -o /app/example.s -I- <source> gnatmake: "<source>" compilation error example.adb:3:11: warning: file name does not match unit name, should be "main.adb" [enabled by default] raised STORAGE_ERROR : stack overflow or erroneous memory access Compiler returned: 4 Latent bug or side effect excluded, I would say that gcc-14-1891-g154c6903957 is the change to blame. I cannot understand just one word of this change. But some skilled gcc maintainers may. Best regards, Franck