Message ID | 20231208134950.14883-1-amonakov@ispras.ru |
---|---|
Headers | show |
Series | Detecting lifetime-dse issues via Valgrind [PR66487] | expand |
On Fri, Dec 08, 2023 at 04:49:49PM +0300, Alexander Monakov wrote: > I would like to propose Valgrind integration previously sent as RFC for trunk. > > Arsen and Sam, since you commented on the RFC I wonder if you can have > a look at the proposed configure and documentation changes and let me > know if they look fine for you? For reference, gccinstall.info will say: Does VALGRIND_MAKE_MEM_UNDEFINED macro ever change onarches once implemented there? Wouldn't this be better done by emitting the sequence inline? Even if it is done in libgcc, it is part of ABI. So, basically add a new optab, valgrind_request, where each target would define_insn whatever is needed (it will need to be a single pattern, it can't be split among multiple) and sorry on -fvalgrind-annotations if the optab is not defined. Advantage would be that --enable-valgrind-interop nor building against valgrind headers is not needed. In your version, did the new function go just to libgcc.a or to libgcc_s.so.1? Having a function in there or not dependent on --enable-valgrind-interop would turn it into an ABI configure option. Jakub
On Fri, 8 Dec 2023, Jakub Jelinek wrote: > Does VALGRIND_MAKE_MEM_UNDEFINED macro ever change onarches once implemented > there? It seems Valgrind folks take binary compatibility seriously, so that sounds unlikely. > Wouldn't this be better done by emitting the sequence inline? > Even if it is done in libgcc, it is part of ABI. I'd rather keep it as simple as possible. We could drop the libgcc parts, users can drop in the wrapper as explained in the manual. > So, basically add a new optab, valgrind_request, where each target would > define_insn whatever is needed (it will need to be a single pattern, it > can't be split among multiple) and sorry on -fvalgrind-annotations if the > optab is not defined. There are going to be complications since the request needs a descriptor structure (on the stack), plus it needs more effort on the GCC side than Valgrind side (when Valgrind is ported to a new target). I'd rather not go that way. > Advantage would be that --enable-valgrind-interop nor building against > valgrind headers is not needed. Alternatively, how about synthesizing an auxiliary translation unit with the wrapper from the driver for -fvalgrind-annotations? > In your version, did the new function go just to libgcc.a or to > libgcc_s.so.1? It participates in libgcc_s link, but it's not listed in the version script, so it's not exported from libgcc_s (and -gc-sections should eliminate it). Alexander
On Fri, Dec 08, 2023 at 06:43:19PM +0300, Alexander Monakov wrote: > On Fri, 8 Dec 2023, Jakub Jelinek wrote: > > In your version, did the new function go just to libgcc.a or to > > libgcc_s.so.1? > > It participates in libgcc_s link, but it's not listed in the version script, > so it's not exported from libgcc_s (and -gc-sections should eliminate it). Then it at least should not participate in that link. There are various other objects which are libgcc.a only (e.g. all of dfp stuff, etc.). Jakub
On Fri, 8 Dec 2023, Jakub Jelinek wrote: > On Fri, Dec 08, 2023 at 06:43:19PM +0300, Alexander Monakov wrote: > > On Fri, 8 Dec 2023, Jakub Jelinek wrote: > > > In your version, did the new function go just to libgcc.a or to > > > libgcc_s.so.1? > > > > It participates in libgcc_s link, but it's not listed in the version script, > > so it's not exported from libgcc_s (and -gc-sections should eliminate it). > > Then it at least should not participate in that link. > There are various other objects which are libgcc.a only (e.g. all of dfp > stuff, etc.). Thanks, changing LIB2ADD += $(srcdir)/valgrind-interop.c to LIB2ADD_ST += $(srcdir)/valgrind-interop.c in my tree achieved that. Alexander