Target-specific builtins (that almost always map to a single corresponding machine instruction) are presently registered with add_builtin_function(). This function takes an `attrs' parameter that can attached additional attributes to the builtin.
Some builtins can indeed be marked pure or const, depending on what the corresponding machine instructions do. However, some do modify global memory and can be marked as neither. When generating coverage information for calls, the flow graph code adds a fake edge to the exit block of the enclosing function, as the compiler is unaware that the builtin function cannot alter control flow by throwing an exception or calling longjmp. What is needed is an ECF_ flag that indicates that the function *will* return and will not alter control flow in any way. It looks like ECF_NOTHROW is not quite right, nor ECF_RETURNS_TWICE. What is really needed is something like "ECF_RETURNS_ONCE", and for need_fake_edge_p to handle this flag appropriately. Does anyone have any advice? Thanks, Ben