Fix target clone indirection elimination
authorYichao Yu <yyc1992@gmail.com>
Fri, 26 Jun 2020 21:46:15 +0000 (15:46 -0600)
committerJeff Law <law@redhat.com>
Fri, 26 Jun 2020 21:49:52 +0000 (15:49 -0600)
commit00e90d3d4cb51fd0fae7b2dbd4bab1db26d6676e
treeb4822e4fbc21194590e4ecb26d9f5c0b31c6d29d
parent67161d24f45601e43abea98f2c3d7d7a462b6eab
Fix target clone indirection elimination

The current logic seems to be comparing the whole attribute tree between
the callee and caller (or at least the tree starting from the target attribute).
This is unnecessary and causes strange dependency of the indirection
elimination on unrelated properties like `noinline`(PR95780) and
`visibility`(PR95778).

This changes the comparison to be only on the `target` attribute which should
be the intent of the code.

gcc

* multiple_target.c (redirect_to_specific_clone): Fix tests
to check individual attribute rather than an attribute list.

gcc/testsuite

* gcc.target/i386/pr95778-1.c: New test.
* gcc.target/i386/pr95778-2.c: New test.
gcc/multiple_target.c
gcc/testsuite/gcc.target/i386/pr95778-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr95778-2.c [new file with mode: 0644]