Re: [PATCH] Fix --enable-gather-detailed-mem-stats build.

2021-01-04 Thread Richard Biener via Gcc-patches
On Wed, Dec 16, 2020 at 10:52 AM Martin Liška wrote: > > On 12/16/20 10:38 AM, Rainer Orth wrote: > > Hi Jakub, > > > >> On Wed, Dec 16, 2020 at 10:20:09AM +0100, Martin Liška wrote: > >>> So vec_mem_desc is not initialized before a static member in module.cc. > >>> We can fix it by using construc

Re: [PATCH] Fix --enable-gather-detailed-mem-stats build.

2020-12-16 Thread Martin Liška
Martin Martin >From 3ac0d258887426b30d3e1885841b1bdf4e53100b Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 16 Dec 2020 10:02:10 +0100 Subject: [PATCH] Fix --enable-gather-detailed-mem-stats build. The build suffers from the static initialization order fiasco: ==30085== Invalid read of size 4 ==

Re: [PATCH] Fix --enable-gather-detailed-mem-stats build.

2020-12-16 Thread Rainer Orth
Hi Jakub, > On Wed, Dec 16, 2020 at 10:20:09AM +0100, Martin Liška wrote: >> So vec_mem_desc is not initialized before a static member in module.cc. >> We can fix it by using constructor attribute. [...] >> + of all static variables. */ >> + >> +static void >> +__attribute__((constructor (101))

Re: [PATCH] Fix --enable-gather-detailed-mem-stats build.

2020-12-16 Thread Martin Liška
On 12/16/20 10:26 AM, Jakub Jelinek wrote: I think this needs to be guarded based on which compiler is used to compile GCC. Do you mean basing that on __GNUC__? Perhaps we could say that we don't support --enable-gather-detailed-mem-stats when the compiler isn't built by GCC (or other compil

Re: [PATCH] Fix --enable-gather-detailed-mem-stats build.

2020-12-16 Thread Jakub Jelinek via Gcc-patches
On Wed, Dec 16, 2020 at 10:20:09AM +0100, Martin Liška wrote: > So vec_mem_desc is not initialized before a static member in module.cc. > We can fix it by using constructor attribute. > > gcc/ChangeLog: > > * vec.c (init_vec_mem_desc): New function. > (vec_prefix::register_overhead):

Re: [PATCH] Fix --enable-gather-detailed-mem-stats build.

2020-12-16 Thread Martin Liška
rom 4ecf4f8df8d5b6b75cfe7cc5df90176e0a5014b8 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 16 Dec 2020 10:02:10 +0100 Subject: [PATCH] Fix --enable-gather-detailed-mem-stats build. The build suffers from the static initialization order fiasco: ==30085== Invalid read of size 4 ==30085==at 0x1D451CD: hash_table_m

Re: [PATCH] Fix --enable-gather-detailed-mem-stats build.

2020-12-16 Thread Iain Sandoe via Gcc-patches
Martin Liška wrote: The build suffers from the static initialization order fiasco: ==30085== Invalid read of size 4 ==30085==at 0x1D451CD: hash_table_mod1 (hash-table.h:344) ==30085==by 0x1D451CD: hash_table::mem_location_hash, vec_usage*, simple_hashmap_traits::mem_location_hash

[PATCH] Fix --enable-gather-detailed-mem-stats build.

2020-12-16 Thread Martin Liška
The build suffers from the static initialization order fiasco: ==30085== Invalid read of size 4 ==30085==at 0x1D451CD: hash_table_mod1 (hash-table.h:344) ==30085==by 0x1D451CD: hash_table::mem_location_hash, vec_usage*, simple_hashmap_traits::mem_location_hash>, vec_usage*> >::hash_ent