This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/64805] Specific use of __attribute ((always_inline)) breaks MPX functionality with -fcheck-pointer-bounds -mmpx
- From: "enkovich.gnu at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 27 Jan 2015 08:49:03 +0000
- Subject: [Bug middle-end/64805] Specific use of __attribute ((always_inline)) breaks MPX functionality with -fcheck-pointer-bounds -mmpx
- Auto-submitted: auto-generated
- References: <bug-64805-4 at http dot gcc dot gnu dot org/bugzilla/>
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);