PR middle-end/100504
gcc/c-family/ChangeLog:
* c-attribs.c (handle_target_clones_attribute): Expect a string
argument to target_clone argument.
gcc/testsuite/ChangeLog:
* gcc.target/i386/pr100504.c: New test.
/* Ensure we have a function type. */
if (TREE_CODE (*node) == FUNCTION_DECL)
{
- if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (*node)))
+ if (TREE_CODE (TREE_VALUE (args)) != STRING_CST)
+ {
+ error ("%qE attribute argument not a string constant", name);
+ *no_add_attrs = true;
+ }
+ else if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (*node)))
{
warning (OPT_Wattributes, "%qE attribute ignored due to conflict "
"with %qs attribute", name, "always_inline");
--- /dev/null
+/* PR middle-end/100504 */
+/* { dg-do compile } */
+
+__attribute__((target_clones(0)))
+foo()
+{ /* { dg-error ".target_clones. attribute argument not a string constant" } */
+}