https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94656
Bug ID: 94656 Summary: target_clones on alias leads to segfault in the compiler Product: gcc Version: 9.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: yyc1992 at gmail dot com CC: marxin at gcc dot gnu.org Target Milestone: --- Compiling the following code with `gcc -c` leads to a segfault in the compiler targetclone pass. ``` __attribute__((target_clones("default,avx"))) void f1() { } __attribute__((target_clones("default,avx"))) void f2() __attribute__((alias("f1"))); ``` The error was. ``` during IPA pass: targetclone src/s_nextafterl.c:6:1: internal compiler error: Segmentation fault 6 | __attribute__((target_clones("default,avx"))) void f2() __attribute__((alias("f1"))); | ^~~~~~~~~~~~~ ``` Now this came from a hack I was playing around and I'm not going to argue if having a target_clone on a alias should be supported (though if the target agrees I think it would be nice to support it... and if not agree a warning would be better IMHO). However, I don't think a segfault is what should happen here = = ....