Since ifunc_resolver is only valid on FUNCTION_DECL, check ifunc_resolver
only on FUNCTION_DECL.

Please test it on Darwin.


H.J.
---
        PR target/85900
        PR target/85345
        * varasm.c (assemble_alias): Check ifunc_resolver only on
        FUNCTION_DECL.
---
 gcc/varasm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/varasm.c b/gcc/varasm.c
index 3bd9cbb69f0..bff43450a91 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -5917,7 +5917,8 @@ assemble_alias (tree decl, tree target)
 # else
       if (!DECL_WEAK (decl))
        {
-         if (cgraph_node::get (decl)->ifunc_resolver)
+         if (TREE_CODE (decl) == FUNCTION_DECL
+             && cgraph_node::get (decl)->ifunc_resolver)
            error_at (DECL_SOURCE_LOCATION (decl),
                      "ifunc is not supported in this configuration");
          else
-- 
2.17.0

Reply via email to