GCC manual (https://gcc.gnu.org/onlinedocs/gccint/Function-Basics.html) states that a result tree for a FUNCTION_DECL can be obtained by using a DECL_RESULT macro. This does not seem to be the case when processing user-defined attributes via a plugin - when GCC calls my callback for handling the attribute, DECL_RESULT always returns a NULL. I have verified, that on PRE_GENERICIZE phase the DECL_RESULT is set up properly.
This is not a big deal, as I can obtain the relevant result using a TREE_TYPE, yet I've spent quite some time looking for bugs in my code and now wonder - is it by design or by some technical reasons that the relevant field in tree is not initialized, or should I file a bug (in either GCC or its documentation)? Cheers, Bartosz Szreder