From: Martin Liska Date: Tue, 19 Sep 2017 08:17:20 +0000 (+0200) Subject: Revert backport revision. X-Git-Tag: releases/gcc-6.5.0~775 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f26b8e1839ad02994582217d703ead5180885de;p=thirdparty%2Fgcc.git Revert backport revision. From-SVN: r252966 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bdb3c5190b6a..23d2985a862e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2017-09-19 Martin Liska + + Revert backport: + 2017-08-10 Martin Liska + + PR c++/81355 + * c-attribs.c (handle_target_attribute): + Report warning for an empty string argument of target attribute. + 2017-09-18 Richard Biener Backport from mainline diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 5089013ddcd4..d6572f71d0dc 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -9439,19 +9439,6 @@ handle_target_attribute (tree *node, tree name, tree args, int flags, flags)) *no_add_attrs = true; - /* Check that there's no empty string in values of the attribute. */ - for (tree t = args; t != NULL_TREE; t = TREE_CHAIN (t)) - { - tree value = TREE_VALUE (t); - if (TREE_CODE (value) == STRING_CST - && TREE_STRING_LENGTH (value) == 1 - && TREE_STRING_POINTER (value)[0] == '\0') - { - warning (OPT_Wattributes, "empty string in attribute %"); - *no_add_attrs = true; - } - } - return NULL_TREE; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bf4436f972e4..6f3740f88ce6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2017-09-19 Martin Liska + + Revert backport: + 2017-08-10 Martin Liska + + PR c++/81355 + * g++.dg/other/pr81355.C: New test. + 2017-09-18 Richard Biener Backport from mainline diff --git a/gcc/testsuite/g++.dg/other/pr81355.C b/gcc/testsuite/g++.dg/other/pr81355.C deleted file mode 100644 index 89d1b4195814..000000000000 --- a/gcc/testsuite/g++.dg/other/pr81355.C +++ /dev/null @@ -1,14 +0,0 @@ -/* { dg-do compile { target x86_64-*-* } } */ - -__attribute__((target("default"))) -int foo() {return 1;} - -__attribute__((target("arch=core2", ""))) -int foo2() {return 2;} /* { dg-warning "empty string in attribute .target." } */ - -__attribute__((target("sse4.2", "", ""))) -int foo3() {return 2;} /* { dg-warning "empty string in attribute .target." } */ - -int main() { - return foo() + foo2() + foo3(); -}