https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79765

Alexander Ivchenko <aivchenk at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aivchenk at gmail dot com

--- Comment #1 from Alexander Ivchenko <aivchenk at gmail dot com> ---
Multi-versioning pass tries to make versions out of mpx chunks, which have no
bodies and hence it fails. I think there is no reason to keep target_clones
attribute for chunks. The following patch helps:

diff --git a/gcc/ipa-chkp.c b/gcc/ipa-chkp.c
index c7fc3a0..5de11b3 100644
--- a/gcc/ipa-chkp.c
+++ b/gcc/ipa-chkp.c
@@ -718,6 +718,9 @@ chkp_produce_thunks (bool early)
                             0, CGRAPH_FREQ_BASE);
          node->create_reference (node->instrumented_version,
                               IPA_REF_CHKP, NULL);
+         DECL_ATTRIBUTES (node->decl)
+           = remove_attribute ("target_clones",
+                               DECL_ATTRIBUTES (node->decl));
          /* Thunk shouldn't be a cdtor.  */
          DECL_STATIC_CONSTRUCTOR (node->decl) = 0;
          DECL_STATIC_DESTRUCTOR (node->decl) = 0;


.. And at "O0" it works. However it fails later on at O1 and above.

gcc/gcc/testsuite/gcc.target/i386/mvc1.c:18:1: error: virtual definition of
statement not up-to-date
 main ()
 ^~~~
_3 = foo.chkp.ifunc ();
gcc/gcc/testsuite/gcc.target/i386/mvc1.c:18:1: internal compiler error:
verify_ssa failed
r0x113ccab verify_ssa(bool, bool)
        ../../gcc/gcc/tree-ssa.c:1184
0xd65f4b execute_function_todo
        ../../gcc/gcc/passes.c:1973
0xd64fab do_per_function
        ../../gcc/gcc/passes.c:1650
0xd660d6 execute_todo
        ../../gcc/gcc/passes.c:2016

Reply via email to