Hi, this patch fixes an ICE on artificial VAR_DECL that has no DECL_NAME set.
<var_decl 0x2aaab5610240 D.1191819 type <array_type 0x2aaab5563000 type <integer_type 0x2aaaac070e70 short unsigned int readonly unsigned HI size <integer_cst 0x2aaaabdd5d68 constant 16> unit size <integer_cst 0x2aaaabdd5d80 constant 2> align 16 symtab 0 alias set -1 canonical type 0x2aaaabdd9738 precision 16 min <integer_cst 0x2aaaabdd5d98 0> max <integer_cst 0x2aaaabdd5d50 65535> pointer_to_this <pointer_type 0x2aaaac939150> reference_to_this <reference_type 0x2aaaac070930>> HI size <integer_cst 0x2aaaabdd5d68 16> unit size <integer_cst 0x2aaaabdd5d80 2> align 16 symtab 0 alias set -1 structural equality domain <integer_type 0x2aaaabfc1f18 type <integer_type 0x2aaaabdd91f8 sizetype> DI size <integer_cst 0x2aaaabdd5bb8 constant 64> unit size <integer_cst 0x2aaaabdd5bd0 constant 8> align 64 symtab 0 alias set -1 canonical type 0x2aaaabdd9930 precision 64 min <integer_cst 0x2aaaabdd5be8 0> max <integer_cst 0x2aaaabdd5be8 0>> pointer_to_this <pointer_type 0x2aaab55630a8>> readonly constant addressable static ignored HI file /aux/hubicka/libreoffice2/core/sw/source/core/unocore/unotbl.cxx line 1896 col 0 size <integer_cst 0x2aaaabdd5d68 16> unit size <integer_cst 0x2aaaabdd5d80 2> align 16 context <function_decl 0x2aaab55828c0 ApplyTableAttr> initial <constructor 0x2aaacb02c0c0>> * ipa-icf.c (sem_item_optimizer::merge_classes): Do not ice when DECL_NAME is not set. Index: ipa-icf.c =================================================================== --- ipa-icf.c (revision 232130) +++ ipa-icf.c (working copy) @@ -3400,7 +3400,8 @@ sem_item_optimizer::merge_classes (unsig sem_item *source = c->members[0]; - if (MAIN_NAME_P (DECL_NAME (source->decl))) + if (DECL_NAME (source->decl) + && MAIN_NAME_P (DECL_NAME (source->decl))) /* If merge via wrappers, picking main as the target can be problematic. */ source = c->members[1];