[PATCH v2] gcov: Add GCOV_TYPE_SIZE target macro

Joseph Myers joseph@codesourcery.com
Tue Aug 10 17:30:15 GMT 2021


On Tue, 10 Aug 2021, Sebastian Huber wrote:

> If -fprofile-update=atomic is used, then the target must provide atomic
> operations for the counters of the type returned by get_gcov_type().
> This is a 64-bit type for targets which have a 64-bit long long type.
> On 32-bit targets this could be an issue since they may not provide
> 64-bit atomic operations.  Allow targets to override the default type
> size with the new GCOV_TYPE_SIZE target macro.

Any target macro needs to be documented in tm.texi.in (and tm.texi 
regenerated).

Please don't add new target macros that are used in both host and target 
code; every such macro is an obstruction to removing inclusion of the host 
tm.h from libgcc.  The appropriate way to handle sharing such 
configuration information is to provide a target hook in the host compiler 
code, and then make c-cppbuiltin.c:c_cpp_builtins define a corresponding 
predefined macro under the "if (flag_building_libgcc)" conditional.  
(Although a target hook is generally preferable to a target macro for 
host-side configuration, when a target macro is used on the host it's 
still desirable not to use it directly in target libraries but to use a 
predefined macro instead.)

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Gcc-patches mailing list