Hi, this is the fifth iteration of this feature (v4: https://patchwork.sourceware.org/project/gcc/patch/[email protected]/)
I decided to split the patch into three pieces, as a single patch would be unreviewable. The first patch does most of the work, as it exposes the attribute, adds tests and moves some code around. The other patches fix up some bugs in the attribute handler. Bootstrapped and regtested as a whole on x86_64-linux. OK for master? Best regards, Josef Josef Melcr (3): Add the callback_only attribute. Use chain_index in callback_only attribute handler. Fix bounds checks in the callback_only attribute handler. gcc/attr-callback.cc | 187 +-------------------------- gcc/attr-callback.h | 7 - gcc/builtin-attrs.def | 18 +-- gcc/c-family/c-attribs.cc | 169 +++++++++++++++++++++++- gcc/cgraph.cc | 11 +- gcc/doc/extend.texi | 39 ++++++ gcc/fortran/f95-lang.cc | 2 +- gcc/ipa-cp.cc | 2 +- gcc/ipa-param-manipulation.cc | 2 +- gcc/ipa-prop.cc | 4 +- gcc/omp-builtins.def | 26 ++-- gcc/testsuite/gcc.dg/attr-callback.c | 107 +++++++++++++++ gcc/testsuite/gcc.dg/ipa/ipcp-cb2.c | 60 +++++++++ gcc/tree-core.h | 2 +- 14 files changed, 412 insertions(+), 224 deletions(-) create mode 100755 gcc/testsuite/gcc.dg/attr-callback.c create mode 100644 gcc/testsuite/gcc.dg/ipa/ipcp-cb2.c -- 2.55.0
