@@ -3012,7 +3012,7 @@ cgraph_node::verify_node (void)
ref_found = true;
}
- if (!ref_found)
+ if (!ref_found && thunk.thunk_p && thunk.add_pointer_bounds_args)
{
error ("Analyzed node has no reference to instrumented version");
error_found = true;
b/gcc/testsuite/gcc.target/i386/mpx/chkp-reference-1.c
new file mode 100644
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcheck-pointer-bounds -mmpx" } */
+
+#include <setjmp.h>
+
+static int
+test1 ()
+{
+ jmp_buf buf;
+ int state;
+
+ state = __builtin_setjmp (buf);
+
+ return state;
+}
+
+void test2 (int(*)());
+
+void
+test3 (void)
+{
+ test2 (test1);
+}