]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Don't check ifunc_resolver on error
authorH.J. Lu <hongjiu.lu@intel.com>
Sat, 26 May 2018 11:35:31 +0000 (11:35 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Sat, 26 May 2018 11:35:31 +0000 (04:35 -0700)
Since ifunc_resolver isn't set when an error is detected, we should
lookup ifunc attribute in this case.

PR target/85900
PR target/85345
* varasm.c (assemble_alias): Lookup ifunc attribute on error.

From-SVN: r260792

gcc/ChangeLog
gcc/varasm.c

index b6836872b0bb8088c18f508ddfee47a9940ade0e..fdfd41ac7851d608c50d04159e0fb106c1e4a2be 100644 (file)
@@ -1,3 +1,9 @@
+2018-05-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/85900
+       PR target/85345
+       * varasm.c (assemble_alias): Lookup ifunc attribute on error.
+
 2018-05-25  Jim Wilson  <jimw@sifive.com>
 
        * config/riscv/riscv-protos.h (riscv_epilogue_uses): New.
index 6b9f87b203f4fd5f60b43d885d95df5c2b5c624b..4d332f502706afb3a8e8f2b25328ce6797164d16 100644 (file)
@@ -5917,8 +5917,9 @@ assemble_alias (tree decl, tree target)
 # else
       if (!DECL_WEAK (decl))
        {
+         /* NB: ifunc_resolver isn't set when an error is detected.  */
          if (TREE_CODE (decl) == FUNCTION_DECL
-             && cgraph_node::get (decl)->ifunc_resolver)
+             && lookup_attribute ("ifunc", DECL_ATTRIBUTES (decl)))
            error_at (DECL_SOURCE_LOCATION (decl),
                      "ifunc is not supported in this configuration");
          else