This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/64805] Specific use of __attribute ((always_inline)) breaks MPX functionality with -fcheck-pointer-bounds -mmpx


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

Ilya Enkovich <enkovich.gnu at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |enkovich.gnu at gmail dot com

--- Comment #2 from Ilya Enkovich <enkovich.gnu at gmail dot com> ---
This might be introduced by the recent changes in always_inline functions
instrumentation.  Now we keep them alive longer and therefore have inline of
the original functionA into the original functionB.  It causes error in a
verifier because inliner clears all references and then calls cgraph node
verification which expects IPA_REF_CHKP reference to instrumented functionB.

I would like to keep IPA_REF_CHKP check in the verifier because this ref is
important for reachability analysis.  Thus we probably should rebuild
IPA_REF_CHKP reference in inliner.  Will tests this patch:

diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index c0ff329..d341619 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -2464,6 +2464,13 @@ early_inliner (function *fun)
 #endif
   node->remove_all_references ();

+  /* Rebuild this reference because it dosn't depend on
+     function's body and it's required to pass cgraph_node
+     verification.  */
+  if (node->instrumented_version
+      && !node->instrumentation_clone)
+    node->create_reference (node->instrumented_version, IPA_REF_CHKP, NULL);
+
   /* Even when not optimizing or not inlining inline always-inline
      functions.  */
   inlined = inline_always_inline_functions (node);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]