Check ifunc_resolver only on FUNCTION_DECL
authorH.J. Lu <hongjiu.lu@intel.com>
Thu, 24 May 2018 19:51:09 +0000 (19:51 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Thu, 24 May 2018 19:51:09 +0000 (12:51 -0700)
Since ifunc_resolver is only valid on FUNCTION_DECL, check ifunc_resolver
only on FUNCTION_DECL.

PR target/85900
PR target/85345
* varasm.c (assemble_alias): Check ifunc_resolver only on
FUNCTION_DECL.

From-SVN: r260683

gcc/ChangeLog
gcc/varasm.c

index 4021500e8eb25be1e30ea2021947319c934bcfaa..1ae5e34e4608ab4a2a15df0dea6e34229cdbaf36 100644 (file)
@@ -1,3 +1,10 @@
+2018-05-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/85900
+       PR target/85345
+       * varasm.c (assemble_alias): Check ifunc_resolver only on
+       FUNCTION_DECL.
+
 2018-05-24  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/85903
index 3bd9cbb69f0e760023b57e837c160b86b052cc26..bff43450a91f756d993049227427cb477055b0a5 100644 (file)
@@ -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