On 11/19/19 11:03 AM, Richard Biener wrote:
On Mon, Nov 18, 2019 at 1:24 PM Martin Liška <mli...@suse.cz> wrote:
Hello.
After my param to option transformation, we lost automatic GGC
detection. It's because init_ggc_heuristics is called before
init_options_struct which memsets all the values to zero first.
I've tested the patch with --enable-checking=release and I hope
Honza can test it more?
Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
Ready to be installed?
I prefer to _not_ move all the functions. Moving the init_ggc_heuristics
call is OK.
I would like to, but opts.o is also put into all wrappers:
g++ -no-pie -g -DIN_GCC -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common
-DHAVE_CONFIG_H -static-libstdc++ -static-libgcc -o xgcc gcc.o gcc-main.o
ggc-none.o \
c/gccspec.o driver-i386.o libcommon-target.a \
libcommon.a ../libcpp/libcpp.a ../libbacktrace/.libs/libbacktrace.a
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld:
libcommon-target.a(opts.o): in function `init_options_struct(gcc_options*,
gcc_options*)':
/home/marxin/Programming/gcc/gcc/opts.c:292: undefined reference to
`init_ggc_heuristics()'
collect2: error: ld returned 1 exit status
make: *** [Makefile:2037: xgcc] Error 1
and adding ggc-common.o to OBJS-libcommon-target will not work.
That's why I also moved the implementation.
Martin
Thanks,
Richard.
Thanks,
Martin
gcc/ChangeLog:
2019-11-18 Martin Liska <mli...@suse.cz>
* ggc-common.c (ggc_rlimit_bound): Move to opts.c
(ggc_min_expand_heuristic): Likewise.
(ggc_min_heapsize_heuristic): Likewise.
(init_ggc_heuristics): Likewise.
* ggc.h (init_ggc_heuristics): Remove declaration.
* opts.c (ggc_rlimit_bound): Moved here from ggc-common.c.
(ggc_min_expand_heuristic): Likewise.
(ggc_min_heapsize_heuristic): Likewise.
(init_ggc_heuristics): Likewise.
(init_options_struct): Init GGC params.
* toplev.c (general_init): Remove call to init_ggc_heuristics.
---
gcc/ggc-common.c | 103 ---------------------------------------------
gcc/ggc.h | 3 --
gcc/opts.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++
gcc/toplev.c | 4 --
4 files changed, 106 insertions(+), 110 deletions(-)