Steven Bosscher wrote:
This reduces peak memory usage for the small test case of PR54146
Bootstrapped&tested on x86_64-unknown-linux-gnu. OK for trunk?
I think it's your patch which breaks bootstrapping here:
Checking multilib configuration for libgcc...
...
checking for suffix of object files... configure: error: in
`/projects/tob/gcc-git/gcc-build/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
conftest.c: In Function »main«:
conftest.c:7:1: internal compiler error: segmentation fault
}
^
Program received signal SIGSEGV, Segmentation fault.
0x00000000005bfa40 in bitmap_obstack_free (map=0x18693a0) at
/projects/tob/gcc-git/gcc/gcc/bitmap.c:388
388 map->first = (bitmap_element *) map->obstack->heads;
(gdb) p map->obstack
$1 = (bitmap_obstack *) 0x9090909090909090
Thus, your patch assumes that malloc returns nullified memory, but e.g.
with MALLOC_PERTURB_ set, that's not the case.
Tobias