From 6d86ddc4d64c2f81dcc62f2778796c461ca3aecb Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 22 May 2019 09:45:17 +0200 Subject: [PATCH] Strip target_clones in copy attribute (PR lto/90500). 2019-05-22 Martin Liska PR lto/90500 * c-attribs.c (handle_copy_attribute): Do not copy target_clones attribute. 2019-05-22 Martin Liska PR lto/90500 * gcc.target/i386/pr90500-1.c: Make the test-case valid now. 2019-05-22 Martin Liska PR lto/90500 * doc/extend.texi: Document the change. From-SVN: r271504 --- gcc/ChangeLog | 5 +++++ gcc/c-family/ChangeLog | 6 ++++++ gcc/c-family/c-attribs.c | 3 ++- gcc/doc/extend.texi | 3 ++- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.target/i386/pr90500-1.c | 3 +-- 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ff5ffdd2f76..d31ac86bdff 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-05-22 Martin Liska + + PR lto/90500 + * doc/extend.texi: Document the change. + 2019-05-22 Richard Biener PR tree-optimization/90450 diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 71cb361b8d6..ae990feeaba 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2019-05-22 Martin Liska + + PR lto/90500 + * c-attribs.c (handle_copy_attribute): Do not copy + target_clones attribute. + 2019-05-21 Eric Botcazou * c-ada-spec.h (enum cpp_operation): Add IS_ASSIGNMENT_OPERATOR. 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/doc/extend.texi b/gcc/doc/extend.texi index e8563fd0803..78197661424 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -2749,7 +2749,8 @@ or variable) must match the kind of symbol to which the argument refers. The @code{copy} attribute copies only syntactic and semantic attributes but not attributes that affect a symbol's linkage or visibility such as @code{alias}, @code{visibility}, or @code{weak}. The @code{deprecated} -attribute is also not copied. @xref{Common Type Attributes}. +and @code{target_clones} attribute are also not copied. +@xref{Common Type Attributes}. @xref{Common Variable Attributes}. For example, the @var{StrongAlias} macro below makes use of the @code{alias} diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5fbb80c052e..270b54f6ab7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2019-05-22 Martin Liska + + PR lto/90500 + * gcc.target/i386/pr90500-1.c: Make the test-case valid + now. + 2019-05-22 Richard Biener * gcc.dg/tree-ssa/ssa-lim-13.c: New testcase. diff --git a/gcc/testsuite/gcc.target/i386/pr90500-1.c b/gcc/testsuite/gcc.target/i386/pr90500-1.c index e90e5ed4674..4282a3e8691 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))); -- 2.30.2