Message ID | 698b867b-864b-047a-042e-33011faba4f0@suse.cz |
---|---|
State | New |
Headers | show |
Series | Strip target_clones in copy attribute (PR lto/90500). | expand |
On 5/21/19 3:32 AM, Martin Liška wrote: > Hi. > > As suggested by Joseph, the patch is about not copying > target_clones attributes in handle_copy_attribute. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Thanks, > Martin > > gcc/c-family/ChangeLog: > > 2019-05-21 Martin Liska <mliska@suse.cz> > > PR lto/90500 > * c-attribs.c (handle_copy_attribute): Do not copy > target_clones attribute. > > gcc/testsuite/ChangeLog: > > 2019-05-21 Martin Liska <mliska@suse.cz> > > PR lto/90500 > * gcc.target/i386/pr90500-1.c: Make the test-case valid > now. I think you need to update the docs to indicate it doesn't copy the target_clones attribute. With that, OK. jeff
diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c index 03203470955..517b7e0dd01 100644 --- a/gcc/c-family/c-attribs.c +++ b/gcc/c-family/c-attribs.c @@ -2486,7 +2486,8 @@ handle_copy_attribute (tree *node, tree name, tree args, || is_attribute_p ("noinline", atname) || is_attribute_p ("visibility", atname) || is_attribute_p ("weak", atname) - || is_attribute_p ("weakref", atname)) + || is_attribute_p ("weakref", atname) + || is_attribute_p ("target_clones", atname)) continue; /* Attribute leaf only applies to extern functions. diff --git a/gcc/testsuite/gcc.target/i386/pr90500-1.c b/gcc/testsuite/gcc.target/i386/pr90500-1.c index 7ac6a739c05..2b4639ca7f9 100644 --- a/gcc/testsuite/gcc.target/i386/pr90500-1.c +++ b/gcc/testsuite/gcc.target/i386/pr90500-1.c @@ -3,6 +3,5 @@ /* { dg-require-ifunc } */ __attribute__((target_clones("arch=haswell", "default"))) int __tanh() {} -__typeof(__tanh) tanhf64 __attribute__((alias("__tanh")))/* { dg-error "clones for .target_clones. attribute cannot be created" } */ - /* { dg-message "'target_clones' cannot be combined with 'alias' attribute" "" { target *-*-* } .-1 } */ +__typeof(__tanh) tanhf64 __attribute__((alias("__tanh"))) __attribute__((__copy__(__tanh)));