> Hello.
>
> ICEs on:
>
> $ cat ice.ii
> #pragma GCC optimize 0
> int main() {}
>
> $ ./xgcc -B. -O2 ice.ii
> during IPA pass: cp
> ice.ii:2:13: internal compiler error: Segmentation fault
> int main() {}
> ^
> 0xdbb6bf crash_signal
> /home/marxin/Programming/gcc/gcc/toplev.c:324
> 0x7ffff6d8ba6f ???
>
> /usr/src/debug/glibc-2.27-5.1.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
> 0x15edd82 ipcp_propagate_stage
> /home/marxin/Programming/gcc/gcc/ipa-cp.c:3292
> 0x15f049a ipcp_driver
> /home/marxin/Programming/gcc/gcc/ipa-cp.c:5081
> 0x15f049a execute
> /home/marxin/Programming/gcc/gcc/ipa-cp.c:5172
I see, it would be cleaner to simply skip !optimize functions in this loop
(and not try to allocate lattices for them), but that is definitly something
for followup.
> >> @@ -1199,7 +1199,8 @@ sem_function::merge (sem_item *alias_item)
> >> "can not create wrapper of stdarg function.\n");
> >> }
> >> else if (ipa_fn_summaries
> >> - && ipa_fn_summaries->get_create (alias)->self_size <= 2)
> >> + && ipa_fn_summaries->get (alias) != NULL
> >> + && ipa_fn_summaries->get (alias)->self_size <= 2)
> >
> > Alias is the target we merge to. In what sictuation it can be unanalyzed?
>
> Can't that also ICE for similar reason as IPA CP?
Hmm, I do not think we should try to merge -O0 functions :)
But again, if you have testcase that triggers this path, we could
handle it later.
Thanks! Patch is OK with keeping those two hunks after the
remaining few changes.
Honza