diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-10-13 17:09:18 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-10-13 17:09:18 +0000 |
commit | 7166161172b816ed738a47c9a7d50f0fbd763c6d (patch) | |
tree | 618d754ad605b42a6cdca53980a97a361d152aa9 | |
parent | 3459bb21384e65c9e01d24a56fc6f1f554293671 (diff) | |
download | gcc-7166161172b816ed738a47c9a7d50f0fbd763c6d.tar.gz |
Simplified GC interface and other goodies.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29946 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/Makefile.in | 2 | ||||
-rw-r--r-- | gcc/config.in | 3 | ||||
-rwxr-xr-x | gcc/configure | 443 | ||||
-rw-r--r-- | gcc/configure.in | 4 | ||||
-rw-r--r-- | gcc/ggc-common.c | 30 | ||||
-rw-r--r-- | gcc/ggc-none.c | 31 | ||||
-rw-r--r-- | gcc/ggc-page.c | 220 | ||||
-rw-r--r-- | gcc/ggc-simple.c | 872 | ||||
-rw-r--r-- | gcc/ggc.h | 83 | ||||
-rw-r--r-- | gcc/rtl.h | 8 | ||||
-rw-r--r-- | gcc/tree.h | 4 |
11 files changed, 706 insertions, 994 deletions
diff --git a/gcc/Makefile.in b/gcc/Makefile.in index fcfa047c34d..7b6b91867e1 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1750,7 +1750,7 @@ s-output : $(md_file) genoutput $(srcdir)/move-if-change $(SHELL) $(srcdir)/move-if-change tmp-output.c insn-output.c touch s-output -genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H) system.h +genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H) system.h ggc.h genrtl.c genrtl.h : s-genrtl @true # force gnu make to recheck modification times. diff --git a/gcc/config.in b/gcc/config.in index b3f068b6998..aec704a5c5c 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -324,6 +324,9 @@ /* Define if you have the sysconf function. */ #undef HAVE_SYSCONF +/* Define if you have the valloc function. */ +#undef HAVE_VALLOC + /* Define if you have the <argz.h> header file. */ #undef HAVE_ARGZ_H diff --git a/gcc/configure b/gcc/configure index 97c804ecfbc..82e392253ae 100755 --- a/gcc/configure +++ b/gcc/configure @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 @@ -91,6 +91,7 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= +sitefile= srcdir= target=NONE verbose= @@ -205,6 +206,7 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -375,6 +377,11 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -540,12 +547,16 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi fi +else + CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -600,7 +611,7 @@ copy=cp # - two terminals occur directly after each other # - the path contains an element with a dot in it echo $ac_n "checking LIBRARY_PATH variable""... $ac_c" 1>&6 -echo "configure:604: checking LIBRARY_PATH variable" >&5 +echo "configure:615: checking LIBRARY_PATH variable" >&5 case ${LIBRARY_PATH} in [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* ) library_path_setting="contains current directory" @@ -625,7 +636,7 @@ fi # - two terminals occur directly after each other # - the path contains an element with a dot in it echo $ac_n "checking GCC_EXEC_PREFIX variable""... $ac_c" 1>&6 -echo "configure:629: checking GCC_EXEC_PREFIX variable" >&5 +echo "configure:640: checking GCC_EXEC_PREFIX variable" >&5 case ${GCC_EXEC_PREFIX} in [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* ) gcc_exec_prefix_setting="contains current directory" @@ -948,7 +959,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:952: checking host system type" >&5 +echo "configure:963: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -969,7 +980,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:973: checking target system type" >&5 +echo "configure:984: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -987,7 +998,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:991: checking build system type" >&5 +echo "configure:1002: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1014,7 +1025,7 @@ test "$host_alias" != "$target_alias" && # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1018: checking for $ac_word" >&5 +echo "configure:1029: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1044,7 +1055,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1048: checking for $ac_word" >&5 +echo "configure:1059: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1095,7 +1106,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1099: checking for $ac_word" >&5 +echo "configure:1110: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1127,7 +1138,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1131: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1142: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1138,12 +1149,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1142 "configure" +#line 1153 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1169,12 +1180,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1173: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1184: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1178: checking whether we are using GNU C" >&5 +echo "configure:1189: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1183,7 +1194,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1187: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1202,7 +1213,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1206: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1217: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1234,7 +1245,7 @@ else fi echo $ac_n "checking for long double""... $ac_c" 1>&6 -echo "configure:1238: checking for long double" >&5 +echo "configure:1249: checking for long double" >&5 if eval "test \"`echo '$''{'gcc_cv_c_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1242,7 +1253,7 @@ else gcc_cv_c_long_double=yes else cat > conftest.$ac_ext <<EOF -#line 1246 "configure" +#line 1257 "configure" #include "confdefs.h" int main() { @@ -1252,7 +1263,7 @@ long double foo = 0.0; switch (0) case 0: case (sizeof(long double) >= sizeof(double)):; ; return 0; } EOF -if { (eval echo configure:1256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_c_long_double=yes else @@ -1285,7 +1296,7 @@ fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1289: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1300: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1313,7 +1324,7 @@ fi echo $ac_n "checking whether a default assembler was specified""... $ac_c" 1>&6 -echo "configure:1317: checking whether a default assembler was specified" >&5 +echo "configure:1328: checking whether a default assembler was specified" >&5 if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then if test x"$gas_flag" = x"no"; then echo "$ac_t""yes ($DEFAULT_ASSEMBLER)" 1>&6 @@ -1325,7 +1336,7 @@ else fi echo $ac_n "checking whether a default linker was specified""... $ac_c" 1>&6 -echo "configure:1329: checking whether a default linker was specified" >&5 +echo "configure:1340: checking whether a default linker was specified" >&5 if test x"${DEFAULT_LINKER+set}" = x"set"; then if test x"$gnu_ld_flag" = x"no"; then echo "$ac_t""yes ($DEFAULT_LINKER)" 1>&6 @@ -1342,7 +1353,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1346: checking for $ac_word" >&5 +echo "configure:1357: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1374,7 +1385,7 @@ done # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1378: checking for $ac_word" >&5 +echo "configure:1389: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1408,7 +1419,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:1412: checking for yywrap in -l$ac_lib" >&5 +echo "configure:1423: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1416,7 +1427,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <<EOF -#line 1420 "configure" +#line 1431 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1427,7 +1438,7 @@ int main() { yywrap() ; return 0; } EOF -if { (eval echo configure:1431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1450,7 +1461,7 @@ fi fi echo $ac_n "checking whether ln works""... $ac_c" 1>&6 -echo "configure:1454: checking whether ln works" >&5 +echo "configure:1465: checking whether ln works" >&5 if eval "test \"`echo '$''{'gcc_cv_prog_LN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1482,7 +1493,7 @@ else fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1486: checking whether ln -s works" >&5 +echo "configure:1497: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'gcc_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1514,19 +1525,19 @@ else fi echo $ac_n "checking for volatile""... $ac_c" 1>&6 -echo "configure:1518: checking for volatile" >&5 +echo "configure:1529: checking for volatile" >&5 if eval "test \"`echo '$''{'gcc_cv_c_volatile'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1523 "configure" +#line 1534 "configure" #include "confdefs.h" int main() { volatile int foo; ; return 0; } EOF -if { (eval echo configure:1530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_c_volatile=yes else @@ -1549,7 +1560,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1553: checking for $ac_word" >&5 +echo "configure:1564: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1581,7 +1592,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1585: checking for $ac_word" >&5 +echo "configure:1596: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1622,7 +1633,7 @@ test -n "$YACC" || YACC="yacc" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1626: checking for a BSD compatible install" >&5 +echo "configure:1637: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1673,7 +1684,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1677: checking how to run the C preprocessor" >&5 +echo "configure:1688: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1688,13 +1699,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 1692 "configure" +#line 1703 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1705,13 +1716,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 1709 "configure" +#line 1720 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1722,13 +1733,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 1726 "configure" +#line 1737 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1753,12 +1764,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1757: checking for ANSI C header files" >&5 +echo "configure:1768: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1762 "configure" +#line 1773 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -1766,7 +1777,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1770: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1783,7 +1794,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 1787 "configure" +#line 1798 "configure" #include "confdefs.h" #include <string.h> EOF @@ -1801,7 +1812,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 1805 "configure" +#line 1816 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -1822,7 +1833,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 1826 "configure" +#line 1837 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1833,7 +1844,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1857,12 +1868,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1861: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1872: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1866 "configure" +#line 1877 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -1871,7 +1882,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1892,12 +1903,12 @@ EOF fi echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6 -echo "configure:1896: checking whether string.h and strings.h may both be included" >&5 +echo "configure:1907: checking whether string.h and strings.h may both be included" >&5 if eval "test \"`echo '$''{'gcc_cv_header_string'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1901 "configure" +#line 1912 "configure" #include "confdefs.h" #include <string.h> #include <strings.h> @@ -1905,7 +1916,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_header_string=yes else @@ -1926,12 +1937,12 @@ EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:1930: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:1941: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1935 "configure" +#line 1946 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/wait.h> @@ -1947,7 +1958,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:1951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -1974,17 +1985,17 @@ for ac_hdr in limits.h stddef.h string.h strings.h stdlib.h time.h \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1978: checking for $ac_hdr" >&5 +echo "configure:1989: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1983 "configure" +#line 1994 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2014,17 +2025,17 @@ done # Check for thread headers. ac_safe=`echo "thread.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for thread.h""... $ac_c" 1>&6 -echo "configure:2018: checking for thread.h" >&5 +echo "configure:2029: checking for thread.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2023 "configure" +#line 2034 "configure" #include "confdefs.h" #include <thread.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2048,17 +2059,17 @@ fi ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for pthread.h""... $ac_c" 1>&6 -echo "configure:2052: checking for pthread.h" >&5 +echo "configure:2063: checking for pthread.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2057 "configure" +#line 2068 "configure" #include "confdefs.h" #include <pthread.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2085,7 +2096,7 @@ fi # Extract the first word of "gnatbind", so it can be a program name with args. set dummy gnatbind; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2089: checking for $ac_word" >&5 +echo "configure:2100: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gnat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2118,12 +2129,12 @@ fi echo $ac_n "checking for preprocessor stringizing operator""... $ac_c" 1>&6 -echo "configure:2122: checking for preprocessor stringizing operator" >&5 +echo "configure:2133: checking for preprocessor stringizing operator" >&5 if eval "test \"`echo '$''{'ac_cv_c_stringize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2127 "configure" +#line 2138 "configure" #include "confdefs.h" #define x(y) #y @@ -2156,12 +2167,12 @@ echo "$ac_t""${ac_cv_c_stringize}" 1>&6 # Use <inttypes.h> only if it exists, # doesn't clash with <sys/types.h>, and declares intmax_t. echo $ac_n "checking for inttypes.h""... $ac_c" 1>&6 -echo "configure:2160: checking for inttypes.h" >&5 +echo "configure:2171: checking for inttypes.h" >&5 if eval "test \"`echo '$''{'gcc_cv_header_inttypes_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2165 "configure" +#line 2176 "configure" #include "confdefs.h" #include <sys/types.h> #include <inttypes.h> @@ -2169,7 +2180,7 @@ int main() { intmax_t i = -1; ; return 0; } EOF -if { (eval echo configure:2173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2184: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_header_inttypes_h=yes else @@ -2192,15 +2203,15 @@ fi for ac_func in strtoul bsearch strerror putenv popen bcopy bzero bcmp \ index rindex strchr strrchr kill getrlimit setrlimit atoll atoq \ sysconf isascii gettimeofday strsignal putc_unlocked fputc_unlocked \ - fputs_unlocked getrusage + fputs_unlocked getrusage valloc do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2199: checking for $ac_func" >&5 +echo "configure:2210: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2204 "configure" +#line 2215 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2223,7 +2234,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2252,12 +2263,12 @@ done #AC_CHECK_TYPE(wchar_t, unsigned int) echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:2256: checking for vprintf" >&5 +echo "configure:2267: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2261 "configure" +#line 2272 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char vprintf(); below. */ @@ -2280,7 +2291,7 @@ vprintf(); ; return 0; } EOF -if { (eval echo configure:2284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -2304,12 +2315,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2308: checking for _doprnt" >&5 +echo "configure:2319: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2313 "configure" +#line 2324 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt(); below. */ @@ -2332,7 +2343,7 @@ _doprnt(); ; return 0; } EOF -if { (eval echo configure:2336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -2368,7 +2379,7 @@ fi echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6 -echo "configure:2372: checking whether the printf functions support %p" >&5 +echo "configure:2383: checking whether the printf functions support %p" >&5 if eval "test \"`echo '$''{'gcc_cv_func_printf_ptr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2376,7 +2387,7 @@ else gcc_cv_func_printf_ptr=no else cat > conftest.$ac_ext <<EOF -#line 2380 "configure" +#line 2391 "configure" #include "confdefs.h" #include <stdio.h> @@ -2389,7 +2400,7 @@ main() exit (p != q); } EOF -if { (eval echo configure:2393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gcc_cv_func_printf_ptr=yes else @@ -2422,12 +2433,12 @@ case "${host}" in ;; esac echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2426: checking for pid_t" >&5 +echo "configure:2437: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2431 "configure" +#line 2442 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -2456,17 +2467,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2460: checking for vfork.h" >&5 +echo "configure:2471: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2465 "configure" +#line 2476 "configure" #include "confdefs.h" #include <vfork.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2470: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2481: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2491,18 +2502,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2495: checking for working vfork" >&5 +echo "configure:2506: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:2501: checking for vfork" >&5 +echo "configure:2512: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2506 "configure" +#line 2517 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char vfork(); below. */ @@ -2525,7 +2536,7 @@ vfork(); ; return 0; } EOF -if { (eval echo configure:2529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -2547,7 +2558,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext <<EOF -#line 2551 "configure" +#line 2562 "configure" #include "confdefs.h" /* Thanks to Paul Eggert for this test. */ #include <stdio.h> @@ -2642,7 +2653,7 @@ main() { } } EOF -if { (eval echo configure:2646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -2668,17 +2679,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2672: checking for $ac_hdr" >&5 +echo "configure:2683: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2677 "configure" +#line 2688 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2682: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2693: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2707,12 +2718,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2711: checking for $ac_func" >&5 +echo "configure:2722: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2716 "configure" +#line 2727 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2735,7 +2746,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2760,7 +2771,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2764: checking for working mmap" >&5 +echo "configure:2775: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2768,7 +2779,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 2772 "configure" +#line 2783 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -2908,7 +2919,7 @@ main() } EOF -if { (eval echo configure:2912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2936,12 +2947,12 @@ for ac_func in bcopy bzero bcmp \ strsignal putc_unlocked fputs_unlocked strstr do echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6 -echo "configure:2940: checking whether $ac_func must be declared" >&5 +echo "configure:2951: checking whether $ac_func must be declared" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_needed_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2945 "configure" +#line 2956 "configure" #include "confdefs.h" #include <stdio.h> @@ -2974,7 +2985,7 @@ int main() { char *(*pfn) = (char *(*)) $ac_func ; return 0; } EOF -if { (eval echo configure:2978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "gcc_cv_decl_needed_$ac_func=no" else @@ -3003,12 +3014,12 @@ done for ac_func in malloc realloc calloc free do echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6 -echo "configure:3007: checking whether $ac_func must be declared" >&5 +echo "configure:3018: checking whether $ac_func must be declared" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_needed_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3012 "configure" +#line 3023 "configure" #include "confdefs.h" #include <stdio.h> @@ -3044,7 +3055,7 @@ int main() { char *(*pfn) = (char *(*)) $ac_func ; return 0; } EOF -if { (eval echo configure:3048: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "gcc_cv_decl_needed_$ac_func=no" else @@ -3073,12 +3084,12 @@ done for ac_func in getrlimit setrlimit getrusage do echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6 -echo "configure:3077: checking whether $ac_func must be declared" >&5 +echo "configure:3088: checking whether $ac_func must be declared" >&5 if eval "test \"`echo '$''{'gcc_cv_decl_needed_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3082 "configure" +#line 3093 "configure" #include "confdefs.h" #include <stdio.h> @@ -3115,7 +3126,7 @@ int main() { char *(*pfn) = (char *(*)) $ac_func ; return 0; } EOF -if { (eval echo configure:3119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "gcc_cv_decl_needed_$ac_func=no" else @@ -3142,12 +3153,12 @@ done echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:3146: checking for sys_siglist declaration in signal.h or unistd.h" >&5 +echo "configure:3157: checking for sys_siglist declaration in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3151 "configure" +#line 3162 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -3159,7 +3170,7 @@ int main() { char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:3163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3174: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -3182,12 +3193,12 @@ fi # mkdir takes a single argument on some systems. echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6 -echo "configure:3186: checking if mkdir takes one argument" >&5 +echo "configure:3197: checking if mkdir takes one argument" >&5 if eval "test \"`echo '$''{'gcc_cv_mkdir_takes_one_arg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3191 "configure" +#line 3202 "configure" #include "confdefs.h" #include <sys/types.h> @@ -3204,7 +3215,7 @@ int main() { mkdir ("foo", 0); ; return 0; } EOF -if { (eval echo configure:3208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_mkdir_takes_one_arg=no else @@ -5968,7 +5979,7 @@ for machine in $build $host $target; do xmake_file=sparc/x-sysv4 extra_parts="crt1.o crti.o crtn.o gmon.o crtbegin.o crtend.o" case $machine in - *-*-solaris2.[0-4]) + *-*-solaris2.0-4) float_format=i128 ;; *) @@ -6278,7 +6289,7 @@ for machine in $build $host $target; do # Distinguish cores, and major variants # arm7m doesn't exist, but D & I don't affect code - xarm[23678] | xarm250 | xarm[67][01]0 \ + xarm[23678] | xarm250 | xarm[67][01]0 \ | xarm7m | xarm7dm | xarm7dmi | xarm7tdmi \ | xarm7100 | xarm7500 | xarm7500fe | xarm810 \ | xstrongarm | xstrongarm110 | xstrongarm1100) @@ -6641,7 +6652,7 @@ fi echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6 -echo "configure:6636: checking for strerror in -lcposix" >&5 +echo "configure:6656: checking for strerror in -lcposix" >&5 ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6649,7 +6660,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcposix $LIBS" cat > conftest.$ac_ext <<EOF -#line 6644 "configure" +#line 6664 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6660,7 +6671,7 @@ int main() { strerror() ; return 0; } EOF -if { (eval echo configure:6655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6683,12 +6694,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:6678: checking for working const" >&5 +echo "configure:6698: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6683 "configure" +#line 6703 "configure" #include "confdefs.h" int main() { @@ -6737,7 +6748,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:6732: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -6758,21 +6769,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:6753: checking for inline" >&5 +echo "configure:6773: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 6760 "configure" +#line 6780 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:6767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -6798,12 +6809,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:6793: checking for off_t" >&5 +echo "configure:6813: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6798 "configure" +#line 6818 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -6831,12 +6842,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:6826: checking for size_t" >&5 +echo "configure:6846: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6831 "configure" +#line 6851 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -6866,19 +6877,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:6861: checking for working alloca.h" >&5 +echo "configure:6881: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6866 "configure" +#line 6886 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:6873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -6899,12 +6910,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:6894: checking for alloca" >&5 +echo "configure:6914: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6899 "configure" +#line 6919 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -6932,7 +6943,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:6927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -6964,12 +6975,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:6959: checking whether alloca needs Cray hooks" >&5 +echo "configure:6979: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6964 "configure" +#line 6984 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -6994,12 +7005,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6989: checking for $ac_func" >&5 +echo "configure:7009: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6994 "configure" +#line 7014 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7022,7 +7033,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:7017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7049,7 +7060,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:7044: checking stack direction for C alloca" >&5 +echo "configure:7064: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7057,7 +7068,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 7052 "configure" +#line 7072 "configure" #include "confdefs.h" find_stack_direction () { @@ -7076,7 +7087,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:7071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -7103,17 +7114,17 @@ unistd.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7098: checking for $ac_hdr" >&5 +echo "configure:7118: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7103 "configure" +#line 7123 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7108: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7143,12 +7154,12 @@ done strdup __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7138: checking for $ac_func" >&5 +echo "configure:7158: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7143 "configure" +#line 7163 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7171,7 +7182,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:7166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7200,12 +7211,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7195: checking for $ac_func" >&5 +echo "configure:7215: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7200 "configure" +#line 7220 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7228,7 +7239,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:7223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7262,19 +7273,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:7257: checking for LC_MESSAGES" >&5 +echo "configure:7277: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7262 "configure" +#line 7282 "configure" #include "confdefs.h" #include <locale.h> int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:7269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -7295,7 +7306,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:7290: checking whether NLS is requested" >&5 +echo "configure:7310: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -7315,7 +7326,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:7310: checking whether included gettext is requested" >&5 +echo "configure:7330: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -7334,17 +7345,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:7329: checking for libintl.h" >&5 +echo "configure:7349: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7334 "configure" +#line 7354 "configure" #include "confdefs.h" #include <libintl.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7361,19 +7372,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:7356: checking for gettext in libc" >&5 +echo "configure:7376: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7361 "configure" +#line 7381 "configure" #include "confdefs.h" #include <libintl.h> int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:7368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -7389,7 +7400,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:7384: checking for bindtextdomain in -lintl" >&5 +echo "configure:7404: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7397,7 +7408,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 7392 "configure" +#line 7412 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7408,7 +7419,7 @@ int main() { bindtextdomain() ; return 0; } EOF -if { (eval echo configure:7403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7424,12 +7435,12 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:7419: checking for gettext in libintl" >&5 +echo "configure:7439: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 -echo "configure:7424: checking for gettext in -lintl" >&5 +echo "configure:7444: checking for gettext in -lintl" >&5 ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7437,7 +7448,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 7432 "configure" +#line 7452 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7448,7 +7459,7 @@ int main() { gettext() ; return 0; } EOF -if { (eval echo configure:7443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7487,7 +7498,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7482: checking for $ac_word" >&5 +echo "configure:7502: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7521,12 +7532,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7516: checking for $ac_func" >&5 +echo "configure:7536: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7521 "configure" +#line 7541 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7549,7 +7560,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:7544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7576,7 +7587,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7571: checking for $ac_word" >&5 +echo "configure:7591: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7612,7 +7623,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7607: checking for $ac_word" >&5 +echo "configure:7627: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7644,7 +7655,7 @@ else fi cat > conftest.$ac_ext <<EOF -#line 7639 "configure" +#line 7659 "configure" #include "confdefs.h" int main() { @@ -7652,7 +7663,7 @@ extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:7647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -7675,7 +7686,7 @@ fi if test "$CATOBJEXT" = "NONE"; then echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6 -echo "configure:7670: checking whether catgets can be used" >&5 +echo "configure:7690: checking whether catgets can be used" >&5 # Check whether --with-catgets or --without-catgets was given. if test "${with_catgets+set}" = set; then withval="$with_catgets" @@ -7688,7 +7699,7 @@ fi if test "$nls_cv_use_catgets" = "yes"; then echo $ac_n "checking for main in -li""... $ac_c" 1>&6 -echo "configure:7683: checking for main in -li" >&5 +echo "configure:7703: checking for main in -li" >&5 ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7696,14 +7707,14 @@ else ac_save_LIBS="$LIBS" LIBS="-li $LIBS" cat > conftest.$ac_ext <<EOF -#line 7691 "configure" +#line 7711 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:7698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7731,12 +7742,12 @@ else fi echo $ac_n "checking for catgets""... $ac_c" 1>&6 -echo "configure:7726: checking for catgets" >&5 +echo "configure:7746: checking for catgets" >&5 if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7731 "configure" +#line 7751 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char catgets(); below. */ @@ -7759,7 +7770,7 @@ catgets(); ; return 0; } EOF -if { (eval echo configure:7754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_catgets=yes" else @@ -7781,7 +7792,7 @@ EOF # Extract the first word of "gencat", so it can be a program name with args. set dummy gencat; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7776: checking for $ac_word" >&5 +echo "configure:7796: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7817,7 +7828,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7812: checking for $ac_word" >&5 +echo "configure:7832: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7854,7 +7865,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7849: checking for $ac_word" >&5 +echo "configure:7869: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7889,7 +7900,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7884: checking for $ac_word" >&5 +echo "configure:7904: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7947,7 +7958,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7942: checking for $ac_word" >&5 +echo "configure:7962: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7981,7 +7992,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7976: checking for $ac_word" >&5 +echo "configure:7996: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8017,7 +8028,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:8012: checking for $ac_word" >&5 +echo "configure:8032: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8110,7 +8121,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:8105: checking for catalogs to be installed" >&5 +echo "configure:8125: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -8138,17 +8149,17 @@ echo "configure:8105: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:8133: checking for linux/version.h" >&5 +echo "configure:8153: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8138 "configure" +#line 8158 "configure" #include "confdefs.h" #include <linux/version.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8143: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8223,7 +8234,7 @@ fi echo $ac_n "checking whether windows registry support is requested""... $ac_c" 1>&6 -echo "configure:8218: checking whether windows registry support is requested" >&5 +echo "configure:8238: checking whether windows registry support is requested" >&5 if test x$enable_win32_registry != xno; then cat >> confdefs.h <<\EOF #define ENABLE_WIN32_REGISTRY 1 @@ -8252,7 +8263,7 @@ esac if test x$enable_win32_registry != xno; then echo $ac_n "checking registry key on windows hosts""... $ac_c" 1>&6 -echo "configure:8247: checking registry key on windows hosts" >&5 +echo "configure:8267: checking registry key on windows hosts" >&5 cat >> confdefs.h <<EOF #define WIN32_REGISTRY_KEY "$gcc_cv_win32_registry_key" EOF @@ -8428,7 +8439,7 @@ fi # Figure out what assembler alignment features are present. echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6 -echo "configure:8423: checking assembler alignment features" >&5 +echo "configure:8443: checking assembler alignment features" >&5 gcc_cv_as= gcc_cv_as_alignment_features= gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas @@ -8549,7 +8560,7 @@ fi echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6 echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6 -echo "configure:8544: checking assembler subsection support" >&5 +echo "configure:8564: checking assembler subsection support" >&5 gcc_cv_as_subsections= if test x$gcc_cv_as != x; then # Check if we have .subsection @@ -8591,7 +8602,7 @@ echo "$ac_t""$gcc_cv_as_subsections" 1>&6 case "$target" in sparc*-*-*) echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6 -echo "configure:8586: checking assembler .register pseudo-op support" >&5 +echo "configure:8606: checking assembler .register pseudo-op support" >&5 gcc_cv_as_register_pseudo_op= if test x$gcc_cv_as != x; then # Check if we have .register @@ -8608,7 +8619,7 @@ EOF echo "$ac_t""$gcc_cv_as_register_pseudo_op" 1>&6 echo $ac_n "checking assembler offsetable %lo() support""... $ac_c" 1>&6 -echo "configure:8603: checking assembler offsetable %lo() support" >&5 +echo "configure:8623: checking assembler offsetable %lo() support" >&5 gcc_cv_as_offsetable_lo10= if test x$gcc_cv_as != x; then # Check if assembler has offsetable %lo() @@ -8645,7 +8656,7 @@ EOF i[34567]86-*-*) echo $ac_n "checking assembler instructions""... $ac_c" 1>&6 -echo "configure:8640: checking assembler instructions" >&5 +echo "configure:8660: checking assembler instructions" >&5 gcc_cv_as_instructions= if test x$gcc_cv_as != x; then set "filds fists" "filds mem; fists mem" @@ -8745,6 +8756,8 @@ esac else if test $ac_cv_func_mmap_fixed_mapped = yes; then GGC=ggc-page +elif test $ac_cv_func_valloc = yes; then + GGC=ggc-page else GGC=ggc-simple fi diff --git a/gcc/configure.in b/gcc/configure.in index 413427894a4..e4c5d586aa4 100644 --- a/gcc/configure.in +++ b/gcc/configure.in @@ -368,7 +368,7 @@ fi AC_CHECK_FUNCS(strtoul bsearch strerror putenv popen bcopy bzero bcmp \ index rindex strchr strrchr kill getrlimit setrlimit atoll atoq \ sysconf isascii gettimeofday strsignal putc_unlocked fputc_unlocked \ - fputs_unlocked getrusage) + fputs_unlocked getrusage valloc) # Make sure wchar_t is available #AC_CHECK_TYPE(wchar_t, unsigned int) @@ -4456,6 +4456,8 @@ AC_ARG_WITH(gc, esac], [if test $ac_cv_func_mmap_fixed_mapped = yes; then GGC=ggc-page +elif test $ac_cv_func_valloc = yes; then + GGC=ggc-page else GGC=ggc-simple fi]) diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index 6df622e8e04..3aa0d998ceb 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -268,21 +268,18 @@ ggc_mark_rtx_children (r) ggc_mark_rtvec (XVEC (r, i)); break; case 'S': case 's': - ggc_mark_string_if_gcable (XSTR (r, i)); + ggc_mark_if_gcable (XSTR (r, i)); break; } } } void -ggc_mark_rtvec (v) +ggc_mark_rtvec_children (v) rtvec v; { int i; - if (v == NULL || ggc_set_mark_rtvec (v)) - return; - i = GET_NUM_ELEM (v); while (--i >= 0) ggc_mark_rtx (RTVEC_ELT (v, i)); @@ -451,3 +448,26 @@ ggc_mark_tree_hash_table (ht) hash_traverse (ht, ggc_mark_tree_hash_table_entry, /*info=*/0); } +/* Allocation wrappers. */ + +char * +ggc_alloc_string (contents, length) + const char *contents; + int length; +{ + char *string; + + if (length < 0) + { + if (contents == NULL) + return NULL; + length = strlen (contents); + } + + string = (char *) ggc_alloc_obj (length + 1, 0); + if (contents != NULL) + memcpy (string, contents, length); + string[length] = 0; + + return string; +} diff --git a/gcc/ggc-none.c b/gcc/ggc-none.c index 4e9ef4aacd7..e05107ec8db 100644 --- a/gcc/ggc-none.c +++ b/gcc/ggc-none.c @@ -35,28 +35,13 @@ /* For now, keep using the old obstack scheme in the gen* programs. */ int ggc_p = 0; -rtx -ggc_alloc_rtx (nslots) - int nslots; +void * +ggc_alloc_obj (size, zero) + size_t size; + int zero; { - int size = sizeof(struct rtx_def) + (nslots - 1) * sizeof(rtunion); - rtx n; - - n = (rtx) xmalloc (size); - bzero ((char *) n, size); - - return n; -} - -rtvec -ggc_alloc_rtvec (nelt) - int nelt; -{ - int size = sizeof (struct rtvec_def) + (nelt - 1) * sizeof (rtx); - rtvec v; - - v = (rtvec) xmalloc (size); - bzero ((char *) v, size); - - return v; + void *p = xmalloc (size); + if (zero) + memset (p, 0, size); + return p; } diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index 1b643e6fa03..048d130e07f 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -27,7 +27,9 @@ #include "flags.h" #include "ggc.h" +#ifdef HAVE_MMAP #include <sys/mman.h> +#endif /* Stategy: @@ -111,10 +113,10 @@ char *empty_string; significant PAGE_L2_BITS and PAGE_L1_BITS are the second and first index values in the lookup table, respectively. - The topmost leftover bits, if any, are ignored. For 32-bit - architectures and the settings below, there are no leftover bits. - For architectures with wider pointers, the lookup tree points to a - list of pages, which must be scanned to find the correct one. */ + For 32-bit architectures and the settings below, there are no + leftover bits. For architectures with wider pointers, the lookup + tree points to a list of pages, which must be scanned to find the + correct one. */ #define PAGE_L1_BITS (8) #define PAGE_L2_BITS (32 - PAGE_L1_BITS - G.lg_pagesize) @@ -178,8 +180,8 @@ typedef page_entry **page_table[PAGE_L1_SIZE]; #else -/* On 64-bit hosts, we use two level page tables plus a linked list - that disambiguates the top 32-bits. There will almost always be +/* On 64-bit hosts, we use the same two level page tables plus a linked + list that disambiguates the top 32-bits. There will almost always be exactly one entry in the list. */ typedef struct page_table_chain { @@ -221,7 +223,7 @@ static struct globals unsigned char context_depth; /* A file descriptor open to /dev/zero for reading. */ -#ifndef MAP_ANONYMOUS +#if defined (HAVE_MMAP) && !defined(MAP_ANONYMOUS) int dev_zero_fd; #endif @@ -258,16 +260,13 @@ static struct globals #define GGC_MIN_LAST_ALLOCATED (4 * 1024 * 1024) -static page_entry *** ggc_lookup_page_table PROTO ((void)); static int ggc_allocated_p PROTO ((const void *)); -static page_entry *lookup_page_table_entry PROTO ((void *)); +static page_entry *lookup_page_table_entry PROTO ((const void *)); static void set_page_table_entry PROTO ((void *, page_entry *)); static char *alloc_anon PROTO ((char *, size_t)); static struct page_entry * alloc_page PROTO ((unsigned)); static void free_page PROTO ((struct page_entry *)); static void release_pages PROTO ((void)); -static void *alloc_obj PROTO ((size_t, int)); -static int mark_obj PROTO ((void *)); static void clear_marks PROTO ((void)); static void sweep_pages PROTO ((void)); @@ -278,37 +277,31 @@ static void poison_pages PROTO ((void)); void debug_print_page_list PROTO ((int)); -/* Returns the lookup table appropriate for looking up P. */ +/* Returns non-zero if P was allocated in GC'able memory. */ -static inline page_entry *** -ggc_lookup_page_table () +static inline int +ggc_allocated_p (p) + const void *p; { page_entry ***base; + size_t L1, L2; #if HOST_BITS_PER_PTR <= 32 base = &G.lookup[0]; #else page_table table = G.lookup; size_t high_bits = (size_t) p & ~ (size_t) 0xffffffff; - while (table->high_bits != high_bits) - table = table->next; + while (1) + { + if (table == NULL) + return 0; + if (table->high_bits == high_bits) + break; + table = table->next; + } base = &table->table[0]; #endif - return base; -} - -/* Returns non-zero if P was allocated in GC'able memory. */ - -static inline int -ggc_allocated_p (p) - const void *p; -{ - page_entry ***base; - size_t L1, L2; - - base = ggc_lookup_page_table (); - /* Extract the level 1 and 2 indicies. */ L1 = LOOKUP_L1 (p); L2 = LOOKUP_L2 (p); @@ -321,12 +314,20 @@ ggc_allocated_p (p) static inline page_entry * lookup_page_table_entry(p) - void *p; + const void *p; { page_entry ***base; size_t L1, L2; - base = ggc_lookup_page_table (); +#if HOST_BITS_PER_PTR <= 32 + base = &G.lookup[0]; +#else + page_table table = G.lookup; + size_t high_bits = (size_t) p & ~ (size_t) 0xffffffff; + while (table->high_bits != high_bits) + table = table->next; + base = &table->table[0]; +#endif /* Extract the level 1 and 2 indicies. */ L1 = LOOKUP_L1 (p); @@ -407,11 +408,12 @@ poison (start, len) (if non-null). */ static inline char * alloc_anon (pref, size) - char *pref; + char *pref ATTRIBUTE_UNUSED; size_t size; { char *page; +#ifdef HAVE_MMAP #ifdef MAP_ANONYMOUS page = (char *) mmap (pref, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); @@ -424,6 +426,16 @@ alloc_anon (pref, size) fputs ("Virtual memory exhausted!\n", stderr); exit(1); } +#else +#ifdef HAVE_VALLOC + page = (char *) valloc (size); + if (!page) + { + fputs ("Virtual memory exhausted!\n", stderr); + exit(1); + } +#endif /* HAVE_VALLOC */ +#endif /* HAVE_MMAP */ return page; } @@ -522,6 +534,7 @@ free_page (entry) static inline void release_pages () { +#ifdef HAVE_MMAP page_entry *p, *next; char *start; size_t len; @@ -553,6 +566,19 @@ release_pages () } munmap (start, len); +#else +#ifdef HAVE_VALLOC + page_entry *p, *next; + + for (p = G.free_pages; p ; p = next) + { + next = p->next; + free (p->page); + free (p); + } +#endif /* HAVE_VALLOC */ +#endif /* HAVE_MMAP */ + G.free_pages = NULL; } @@ -582,8 +608,8 @@ static unsigned char const size_lookup[257] = /* Allocate a chunk of memory of SIZE bytes. If ZERO is non-zero, the memory is zeroed; otherwise, its contents are undefined. */ -static void * -alloc_obj (size, zero) +void * +ggc_alloc_obj (size, zero) size_t size; int zero; { @@ -700,8 +726,8 @@ alloc_obj (size, zero) /* If P is not marked, marks it and returns 0. Otherwise returns 1. P must have been allocated by the GC allocator; it mustn't point to static objects, stack variables, or memory allocated with malloc. */ -static int -mark_obj (p) +int +ggc_set_mark (p) void *p; { page_entry *entry; @@ -738,6 +764,13 @@ mark_obj (p) return 0; } +void +ggc_mark_if_gcable (p) + void *p; +{ + if (p && ggc_allocated_p (p)) + ggc_set_mark (p); +} /* Initialize the ggc-mmap allocator. */ void @@ -746,7 +779,7 @@ init_ggc () G.pagesize = getpagesize(); G.lg_pagesize = exact_log2 (G.pagesize); -#ifndef MAP_ANONYMOUS +#if defined (HAVE_MMAP) && !defined(MAP_ANONYMOUS) G.dev_zero_fd = open ("/dev/zero", O_RDONLY); if (G.dev_zero_fd == -1) abort (); @@ -812,64 +845,6 @@ ggc_pop_context () } } } - - -struct rtx_def * -ggc_alloc_rtx (nslots) - int nslots; -{ - return (struct rtx_def *) - alloc_obj (sizeof (struct rtx_def) + (nslots - 1) * sizeof (rtunion), 1); -} - - -struct rtvec_def * -ggc_alloc_rtvec (nelt) - int nelt; -{ - return (struct rtvec_def *) - alloc_obj (sizeof (struct rtvec_def) + (nelt - 1) * sizeof (rtx), 1); -} - - -union tree_node * -ggc_alloc_tree (length) - int length; -{ - return (union tree_node *) alloc_obj (length, 1); -} - - -char * -ggc_alloc_string (contents, length) - const char *contents; - int length; -{ - char *string; - - if (length < 0) - { - if (contents == NULL) - return NULL; - length = strlen (contents); - } - - string = (char *) alloc_obj (length + 1, 0); - if (contents != NULL) - memcpy (string, contents, length); - string[length] = 0; - - return string; -} - - -void * -ggc_alloc (size) - size_t size; -{ - return alloc_obj (size, 0); -} - static inline void clear_marks () @@ -1072,54 +1047,9 @@ ggc_collect () time = get_run_time () - time; gc_time += time; - time = (time + 500) / 1000; if (!quiet_flag) - fprintf (stderr, "%luk in %d.%03d}", - (unsigned long) G.allocated / 1024, time / 1000, time % 1000); -} - - -int -ggc_set_mark_rtx (r) - rtx r; -{ - return mark_obj (r); -} - -int -ggc_set_mark_rtvec (v) - rtvec v; -{ - return mark_obj (v); -} - -int -ggc_set_mark_tree (t) - tree t; -{ - return mark_obj (t); -} - -void -ggc_mark_string (s) - char *s; -{ - if (s) - mark_obj (s); -} - -void -ggc_mark_string_if_gcable (s) - char *s; -{ - if (s && ggc_allocated_p (s)) - mark_obj (s); -} - -void -ggc_mark (p) - void *p; -{ - if (p) - mark_obj (p); + { + fprintf (stderr, "%luk in %.3f}", + (unsigned long) G.allocated / 1024, time * 1e-6); + } } diff --git a/gcc/ggc-simple.c b/gcc/ggc-simple.c index d8ed4a15a53..f665487cd53 100644 --- a/gcc/ggc-simple.c +++ b/gcc/ggc-simple.c @@ -28,69 +28,74 @@ #include "hash.h" #include "ggc.h" +#ifndef offsetof +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#endif + /* Debugging flags. */ /* Zap memory before freeing to catch dangling pointers. */ #define GGC_POISON -/* Log alloc and release. Don't enable this unless you want a - really really lot of data. */ -#undef GGC_DUMP +/* Collect statistics on how bushy the search tree is. */ +#undef GGC_BALANCE -/* Some magic tags for strings and anonymous memory, hoping to catch - certain errors wrt marking memory. */ +/* Perform collection every time ggc_collect is invoked. Otherwise, + collection is performed only when a significant amount of memory + has been allocated since the last collection. */ +#undef GGC_ALWAYS_COLLECT -#define IS_MARKED(X) ((X) & 1) -#define IGNORE_MARK(X) ((X) & -2) +/* Always verify that the to-be-marked memory is collectable. */ +#undef GGC_ALWAYS_VERIFY -#define GGC_STRING_MAGIC ((unsigned int)0xa1b2c3d4) -#define GGC_STRING_MAGIC_MARK ((unsigned int)0xa1b2c3d4 | 1) - -#define GGC_ANY_MAGIC ((unsigned int)0xa9bacbdc) -#define GGC_ANY_MAGIC_MARK ((unsigned int)0xa9bacbdc | 1) +#ifdef ENABLE_CHECKING +#define GGC_POISON +#define GGC_ALWAYS_COLLECT +#define GGC_ALWAYS_VERIFY +#endif /* Constants for general use. */ char *empty_string; +extern int gc_time; -/* Global lists of roots, rtxs, and trees. */ +#ifndef HOST_BITS_PER_PTR +#define HOST_BITS_PER_PTR HOST_BITS_PER_LONG +#endif -struct ggc_rtx -{ - struct ggc_rtx *chain; - struct rtx_def rtx; -}; +/* We'd like a balanced tree, but we don't really want to pay for the + cost of keeping the tree balanced. We'll settle for the next best + thing -- nearly balanced. -struct ggc_rtvec -{ - struct ggc_rtvec *chain; - struct rtvec_def vec; -}; + In this context, the most natural key is the node pointer itself, + but due to the way memory managers work, we'd be virtually certain + to wind up with a completely degenerate straight line. What's needed + is to make something more variable, and yet predictable, be more + significant in the comparison. -struct ggc_tree -{ - struct ggc_tree *chain; - union tree_node tree; -}; + The handiest source of variability is the low bits of the pointer + value itself. Any sort of bit/byte swap would do, but such machine + specific operations are not handy, and we don't want to put that much + effort into it. */ -struct ggc_string -{ - struct ggc_string *chain; - unsigned int magic_mark; - char string[1]; -}; +#define PTR_KEY(p) ((size_t)p << (HOST_BITS_PER_PTR - 8) \ + | ((size_t)p & 0xff00) << (HOST_BITS_PER_PTR - 24) \ + | (size_t)p >> 16) -/* A generic allocation, with an external mark bit. */ +/* GC'able memory; a node in a binary search tree. */ -struct ggc_any +struct ggc_mem { - struct ggc_any *chain; - unsigned int magic_mark; + /* A combination of the standard left/right nodes, indexable by `<'. */ + struct ggc_mem *sub[2]; + + unsigned int mark : 1; + unsigned int context : 7; + unsigned int size : 24; /* Make sure the data is reasonably aligned. */ union { - char c; - HOST_WIDE_INT i; + HOST_WIDEST_INT i; #ifdef HAVE_LONG_DOUBLE long double d; #else @@ -99,642 +104,373 @@ struct ggc_any } u; }; -struct ggc_status +static struct globals { - struct ggc_status *next; - struct ggc_rtx *rtxs; - struct ggc_rtvec *vecs; - struct ggc_tree *trees; - struct ggc_string *strings; - struct ggc_any *anys; - size_t bytes_alloced_since_gc; -}; + /* Root of the object tree. */ + struct ggc_mem *root; -/* A chain of GGC contexts. The currently active context is at the - front of the chain. */ -static struct ggc_status *ggc_chain; + /* Data bytes currently allocated. */ + size_t allocated; -/* The table of all allocated strings. Only valid during collection. */ -static varray_type ggc_allocated_strings; -static size_t ggc_strings_used; + /* Data objects currently allocated. */ + size_t objects; -/* Some statistics. */ + /* Data bytes allocated at time of last GC. */ + size_t allocated_last_gc; -static int n_rtxs_collected; -static int n_vecs_collected; -static int n_trees_collected; -static int n_strings_collected; -static int n_anys_collected; -extern int gc_time; + /* Current context level. */ + int context; +} G; -#ifdef GGC_DUMP -static FILE *dump; -#endif - -/* Local function prototypes. */ +/* Skip garbage collection if the current allocation is not at least + this factor times the allocation at the end of the last collection. + In other words, total allocation must expand by (this factor minus + one) before collection is performed. */ +#define GGC_MIN_EXPAND_FOR_GC (1.3) -static void ggc_free_rtx PROTO ((struct ggc_rtx *r)); -static void ggc_free_rtvec PROTO ((struct ggc_rtvec *v)); -static void ggc_free_tree PROTO ((struct ggc_tree *t)); -static void ggc_free_string PROTO ((struct ggc_string *s)); -static void ggc_free_any PROTO ((struct ggc_any *a)); -static int ggc_compare_addresses PROTO ((const void *, const void *)); +/* Bound `allocated_last_gc' to 4MB, to prevent the memory expansion + test from triggering too often when the heap is small. */ +#define GGC_MIN_LAST_ALLOCATED (4 * 1024 * 1024) -/* Called once to initialize the garbage collector. */ +/* Local function prototypes. */ -void -init_ggc PROTO ((void)) -{ - /* Initialize the global context. */ - ggc_push_context (); +static void tree_insert PROTO ((struct ggc_mem *)); +static int tree_lookup PROTO ((struct ggc_mem *)); +static void clear_marks PROTO ((struct ggc_mem *)); +static void sweep_objs PROTO ((struct ggc_mem **)); +static void ggc_pop_context_1 PROTO ((struct ggc_mem *, int)); -#ifdef GGC_DUMP - dump = fopen ("zgcdump", "w"); - setlinebuf (dump); +#ifdef GGC_BALANCE +extern void debug_ggc_balance PROTO ((void)); +static void tally_leaves PROTO ((struct ggc_mem *, int, size_t *, size_t *)); #endif - empty_string = ggc_alloc_string ("", 0); - ggc_add_string_root (&empty_string, 1); -} - -/* Start a new GGC context. Memory allocated in previous contexts - will not be collected while the new context is active. */ - -void -ggc_push_context PROTO ((void)) -{ - struct ggc_status *gs = (struct ggc_status *) xcalloc (1, sizeof (*gs)); - gs->next = ggc_chain; - ggc_chain = gs; -} - -/* Finish a GC context. Any uncollected memory in the new context - will be merged with the old context. */ +/* Insert V into the search tree. */ -void -ggc_pop_context PROTO ((void)) +static inline void +tree_insert (v) + struct ggc_mem *v; { - struct ggc_rtx *r; - struct ggc_rtvec *v; - struct ggc_tree *t; - struct ggc_string *s; - struct ggc_any *a; - struct ggc_status *gs; - - gs = ggc_chain; + size_t v_key = PTR_KEY (v); + struct ggc_mem *p, **pp; - r = gs->rtxs; - if (r) - { - while (r->chain) - r = r->chain; - r->chain = gs->next->rtxs; - gs->next->rtxs = gs->rtxs; - } - - v = gs->vecs; - if (v) + for (pp = &G.root, p = *pp; p ; p = *pp) { - while (v->chain) - v = v->chain; - v->chain = gs->next->vecs; - gs->next->vecs = gs->vecs; + size_t p_key = PTR_KEY (p); + pp = &p->sub[v_key < p_key]; } + *pp = v; +} - t = gs->trees; - if (t) - { - while (t->chain) - t = t->chain; - t->chain = gs->next->trees; - gs->next->trees = gs->trees; - } +/* Return true if V is in the tree. */ - s = gs->strings; - if (s) - { - while (s->chain) - s = s->chain; - s->chain = gs->next->strings; - gs->next->strings = gs->strings; - } +static inline int +tree_lookup (v) + struct ggc_mem *v; +{ + size_t v_key = PTR_KEY (v); + struct ggc_mem *p = G.root; - a = gs->anys; - if (a) + while (p) { - while (a->chain) - a = a->chain; - a->chain = gs->next->anys; - gs->next->anys = gs->anys; + size_t p_key = PTR_KEY (p); + if (p == v) + return 1; + p = p->sub[v_key < p_key]; } - gs->next->bytes_alloced_since_gc += gs->bytes_alloced_since_gc; - - ggc_chain = gs->next; - free (gs); + return 0; } -/* These allocators are dreadfully simple, with no caching whatsoever so - that Purify-like tools that do allocation versioning can catch errors. - This collector is never going to go fast anyway. */ +/* Alloc SIZE bytes of GC'able memory. If ZERO, clear the memory. */ -rtx -ggc_alloc_rtx (nslots) - int nslots; +void * +ggc_alloc_obj (size, zero) + size_t size; + int zero; { - struct ggc_rtx *n; - int size = sizeof(*n) + (nslots-1) * sizeof(rtunion); + struct ggc_mem *x; - n = (struct ggc_rtx *) xcalloc (1, size); - n->chain = ggc_chain->rtxs; - ggc_chain->rtxs = n; + x = (struct ggc_mem *) xmalloc (offsetof (struct ggc_mem, u) + size); + x->sub[0] = NULL; + x->sub[1] = NULL; + x->mark = 0; + x->context = G.context; + x->size = size; -#ifdef GGC_DUMP - fprintf (dump, "alloc rtx %p\n", &n->rtx); -#endif + if (zero) + memset (&x->u, 0, size); - ggc_chain->bytes_alloced_since_gc += size; + tree_insert (x); + G.allocated += size; + G.objects += 1; - return &n->rtx; + return &x->u; } -rtvec -ggc_alloc_rtvec (nelt) - int nelt; -{ - struct ggc_rtvec *v; - int size = sizeof (*v) + (nelt - 1) * sizeof (rtx); - - v = (struct ggc_rtvec *) xcalloc (1, size); - v->chain = ggc_chain->vecs; - ggc_chain->vecs = v; - -#ifdef GGC_DUMP - fprintf(dump, "alloc vec %p\n", &v->vec); -#endif - - ggc_chain->bytes_alloced_since_gc += size; - - return &v->vec; -} +/* Mark a node. */ -tree -ggc_alloc_tree (length) - int length; +int +ggc_set_mark (p) + void *p; { - struct ggc_tree *n; - int size = sizeof(*n) - sizeof(n->tree) + length; - - n = (struct ggc_tree *) xcalloc (1, size); - n->chain = ggc_chain->trees; - ggc_chain->trees = n; + struct ggc_mem *x; -#ifdef GGC_DUMP - fprintf(dump, "alloc tree %p\n", &n->tree); + x = (struct ggc_mem *) ((char *)p - offsetof (struct ggc_mem, u)); +#ifdef GGC_ALWAYS_VERIFY + if (! tree_lookup (x)) + abort (); #endif - ggc_chain->bytes_alloced_since_gc += size; - - return &n->tree; -} - -char * -ggc_alloc_string (contents, length) - const char *contents; - int length; -{ - struct ggc_string *s; - int size; - - if (length < 0) - { - if (contents == NULL) - return NULL; - length = strlen (contents); - } - - size = (s->string - (char *)s) + length + 1; - s = (struct ggc_string *) xmalloc (size); - s->chain = ggc_chain->strings; - s->magic_mark = GGC_STRING_MAGIC; - ggc_chain->strings = s; - - if (contents) - memcpy (s->string, contents, length); - s->string[length] = 0; - -#ifdef GGC_DUMP - fprintf(dump, "alloc string %p\n", &s->string); -#endif + if (x->mark) + return 1; - ggc_chain->bytes_alloced_since_gc += size; + x->mark = 1; + G.allocated += x->size; + G.objects += 1; - return s->string; + return 0; } -/* Like xmalloc, but allocates GC-able memory. */ - -void * -ggc_alloc (bytes) - size_t bytes; +void +ggc_mark_if_gcable (p) + void *p; { - struct ggc_any *a; + struct ggc_mem *x; - if (bytes == 0) - bytes = 1; - bytes += (&((struct ggc_any *) 0)->u.c - (char *) 0); + if (p == NULL) + return; - a = (struct ggc_any *) xmalloc (bytes); - a->chain = ggc_chain->anys; - a->magic_mark = GGC_ANY_MAGIC; - ggc_chain->anys = a; + x = (struct ggc_mem *) ((char *)p - offsetof (struct ggc_mem, u)); + if (! tree_lookup (x)) + return; - ggc_chain->bytes_alloced_since_gc += bytes; + if (x->mark) + return; - return &a->u; + x->mark = 1; + G.allocated += x->size; + G.objects += 1; } -/* Freeing a bit of rtl is as simple as calling free. */ - -static inline void -ggc_free_rtx (r) - struct ggc_rtx *r; +static void +clear_marks (x) + struct ggc_mem *x; { -#ifdef GGC_DUMP - fprintf (dump, "collect rtx %p\n", &r->rtx); -#endif -#ifdef GGC_POISON - memset (r, 0xAA, sizeof(*r) + ((GET_RTX_LENGTH (r->rtx.code) -1) - * sizeof(rtunion))); -#endif - - free (r); + x->mark = 0; + if (x->sub[0]) + clear_marks (x->sub[0]); + if (x->sub[1]) + clear_marks (x->sub[1]); } -/* Freeing an rtvec is as simple as calling free. */ - -static inline void -ggc_free_rtvec (v) - struct ggc_rtvec *v; +static void +sweep_objs (root) + struct ggc_mem **root; { -#ifdef GGC_DUMP - fprintf(dump, "collect vec %p\n", &v->vec); -#endif -#ifdef GGC_POISON - memset (v, 0xBB, sizeof (*v) + ((GET_NUM_ELEM (&v->vec) - 1) - * sizeof (rtx))); -#endif + struct ggc_mem *x = *root; + if (!x) + return; - free (v); -} + sweep_objs (&x->sub[0]); + sweep_objs (&x->sub[1]); -/* Freeing a tree node is almost, but not quite, as simple as calling free. - Mostly we need to let the language clean up its lang_specific bits. */ + if (! x->mark && x->context >= G.context) + { + struct ggc_mem *l, *r; + + l = x->sub[0]; + r = x->sub[1]; + if (!l) + *root = r; + else if (!r) + *root = l; + else if (!l->sub[1]) + { + *root = l; + l->sub[1] = r; + } + else if (!r->sub[0]) + { + *root = r; + r->sub[0] = l; + } + else + { + *root = l; + do { + root = &l->sub[1]; + } while ((l = *root) != NULL); + *root = r; + } -static inline void -ggc_free_tree (t) - struct ggc_tree *t; -{ -#ifdef GGC_DUMP - fprintf (dump, "collect tree %p\n", &t->tree); -#endif #ifdef GGC_POISON - memset(&t->tree.common, 0xCC, sizeof(t->tree.common)); + memset (&x->u, 0xA5, x->size); #endif - free (t); + free (x); + } } -/* Freeing a string is as simple as calling free. */ +/* The top level mark-and-sweep routine. */ -static inline void -ggc_free_string (s) - struct ggc_string *s; +void +ggc_collect () { -#ifdef GGC_DUMP - fprintf(dump, "collect string %p\n", s->string); -#endif -#ifdef GGC_POISON - s->magic_mark = 0xDDDDDDDD; - s->string[0] = 0xDD; + int time; + +#ifndef GGC_ALWAYS_COLLECT + if (G.allocated < GGC_MIN_EXPAND_FOR_GC * G.allocated_last_gc) + return; #endif - free (s); -} +#ifdef GGC_BALANCE + debug_ggc_balance (); +#endif -/* Freeing anonymous memory is as simple as calling free. */ + time = get_run_time (); + if (!quiet_flag) + fprintf (stderr, " {GC %luk -> ", (unsigned long)G.allocated / 1024); -static inline void -ggc_free_any (a) - struct ggc_any *a; -{ -#ifdef GGC_DUMP - fprintf(dump, "collect mem %p\n", &a->u); -#endif -#ifdef GGC_POISON - a->magic_mark = 0xEEEEEEEE; -#endif + G.allocated = 0; + G.objects = 0; - free (a); -} + clear_marks (G.root); + ggc_mark_roots (); + sweep_objs (&G.root); -/* Mark a node. */ + G.allocated_last_gc = G.allocated; + if (G.allocated_last_gc < GGC_MIN_LAST_ALLOCATED) + G.allocated_last_gc = GGC_MIN_LAST_ALLOCATED; -int -ggc_set_mark_rtx (r) - rtx r; -{ - int marked = r->gc_mark; - if (! marked) - r->gc_mark = 1; - return marked; -} + time = get_run_time () - time; + gc_time += time; -int -ggc_set_mark_rtvec (v) - rtvec v; -{ - int marked = v->gc_mark; - if (! marked) - v->gc_mark = 1; - return marked; -} + if (!quiet_flag) + { + fprintf (stderr, "%luk in %.3f}", + (unsigned long) G.allocated / 1024, time * 1e-6); + } -int -ggc_set_mark_tree (t) - tree t; -{ - int marked = t->common.gc_mark; - if (! marked) - t->common.gc_mark = 1; - return marked; +#ifdef GGC_BALANCE + debug_ggc_balance (); +#endif } -/* Compare the pointers pointed to by A1 and A2. Used as a callback - for qsort/bsearch. */ +/* Called once to initialize the garbage collector. */ -static int -ggc_compare_addresses (a1, a2) - const void *a1; - const void *a2; +void +init_ggc () { - const char *c1 = *((const char **) a1); - const char *c2 = *((const char **) a2); + G.allocated_last_gc = GGC_MIN_LAST_ALLOCATED; - if (c1 < c2) - return -1; - else if (c1 > c2) - return 1; - else - return 0; + empty_string = ggc_alloc_string ("", 0); + ggc_add_string_root (&empty_string, 1); } +/* Start a new GGC context. Memory allocated in previous contexts + will not be collected while the new context is active. */ + void -ggc_mark_string (s) - char *s; +ggc_push_context () { - const ptrdiff_t d = (((struct ggc_string *) 0)->string - (char *) 0); - struct ggc_string *gs; + G.context++; - if (s == NULL) - return; - - gs = (struct ggc_string *)(s - d); - if (IGNORE_MARK (gs->magic_mark) != GGC_STRING_MAGIC) - return; /* abort? */ - gs->magic_mark = GGC_STRING_MAGIC_MARK; + /* We only allocated 7 bits in the node for the context. This + should be more than enough. */ + if (G.context >= 128) + abort (); } +/* Finish a GC context. Any uncollected memory in the new context + will be merged with the old context. */ -void -ggc_mark_string_if_gcable (s) - char *s; +void +ggc_pop_context () { - if (s && !bsearch (&s, - &VARRAY_CHAR_PTR (ggc_allocated_strings, 0), - ggc_strings_used, sizeof (char *), - ggc_compare_addresses)) - return; - - ggc_mark_string (s); + G.context--; + if (G.root) + ggc_pop_context_1 (G.root, G.context); } - -/* Mark P, allocated with ggc_alloc. */ - -void -ggc_mark (p) - void *p; +static void +ggc_pop_context_1 (x, c) + struct ggc_mem *x; + int c; { - const ptrdiff_t d = (&((struct ggc_any *) 0)->u.c - (char *) 0); - struct ggc_any *a; - - if (p == NULL) - return; - - a = (struct ggc_any *) (((char*) p) - d); - if (IGNORE_MARK (a->magic_mark) != GGC_ANY_MAGIC) - abort (); - a->magic_mark = GGC_ANY_MAGIC_MARK; + if (x->context > c) + x->context = c; + if (x->sub[0]) + ggc_pop_context_1 (x->sub[0], c); + if (x->sub[1]) + ggc_pop_context_1 (x->sub[1], c); } -/* The top level mark-and-sweep routine. */ +/* Dump a tree. */ void -ggc_collect () +debug_ggc_tree (p, indent) + struct ggc_mem *p; + int indent; { - struct ggc_rtx *r, **rp; - struct ggc_rtvec *v, **vp; - struct ggc_tree *t, **tp; - struct ggc_string *s, **sp; - struct ggc_status *gs; - struct ggc_any *a, **ap; - int time, n_rtxs, n_trees, n_vecs, n_strings, n_anys; - -#if !defined(ENABLE_CHECKING) - /* See if it's even worth our while. */ - if (ggc_chain->bytes_alloced_since_gc < 4*1024*1024) - return; -#endif - - if (!quiet_flag) - fputs (" {GC ", stderr); - - time = get_run_time (); - - /* Set up the table of allocated strings. */ - VARRAY_CHAR_PTR_INIT (ggc_allocated_strings, 1024, "allocated strings"); - ggc_strings_used = 0; - - /* Clean out all of the GC marks. */ - for (gs = ggc_chain; gs; gs = gs->next) - { - for (r = gs->rtxs; r != NULL; r = r->chain) - r->rtx.gc_mark = 0; - for (v = gs->vecs; v != NULL; v = v->chain) - v->vec.gc_mark = 0; - for (t = gs->trees; t != NULL; t = t->chain) - t->tree.common.gc_mark = 0; - for (s = gs->strings; s != NULL; s = s->chain) - { - s->magic_mark = GGC_STRING_MAGIC; - if (ggc_strings_used == ggc_allocated_strings->num_elements) - VARRAY_GROW (ggc_allocated_strings, 2 * ggc_strings_used); - VARRAY_CHAR_PTR (ggc_allocated_strings, ggc_strings_used) - = &s->string[0]; - ++ggc_strings_used; - } - for (a = gs->anys; a != NULL; a = a->chain) - a->magic_mark = GGC_ANY_MAGIC; - } - - /* Sort the allocated string table. */ - qsort (&VARRAY_CHAR_PTR (ggc_allocated_strings, 0), - ggc_strings_used, sizeof (char *), - ggc_compare_addresses); - - ggc_mark_roots (); + int i; - /* Free the string table. */ - VARRAY_FREE (ggc_allocated_strings); - - /* Sweep the resulting dead nodes. */ - - /* The RTXs. */ - - rp = &ggc_chain->rtxs; - r = ggc_chain->rtxs; - n_rtxs = 0; - while (r != NULL) + if (!p) { - struct ggc_rtx *chain = r->chain; - if (!r->rtx.gc_mark) - { - ggc_free_rtx (r); - *rp = chain; - n_rtxs++; - } - else - rp = &r->chain; - r = chain; + fputs ("(nil)\n", stderr); + return; } - *rp = NULL; - n_rtxs_collected += n_rtxs; - /* The vectors. */ + if (p->sub[0]) + debug_ggc_tree (p->sub[0], indent + 1); - vp = &ggc_chain->vecs; - v = ggc_chain->vecs; - n_vecs = 0; - while (v != NULL) - { - struct ggc_rtvec *chain = v->chain; - if (!v->vec.gc_mark) - { - ggc_free_rtvec (v); - *vp = chain; - n_vecs++; - } - else - vp = &v->chain; - v = chain; - } - *vp = NULL; - n_vecs_collected += n_vecs; - - /* The trees. */ - - tp = &ggc_chain->trees; - t = ggc_chain->trees; - n_trees = 0; - while (t != NULL) - { - struct ggc_tree *chain = t->chain; - if (!t->tree.common.gc_mark) - { - ggc_free_tree (t); - *tp = chain; - n_trees++; - } - else - tp = &t->chain; - t = chain; - } - *tp = NULL; - n_trees_collected += n_trees; - - /* The strings. */ + for (i = 0; i < indent; ++i) + putc (' ', stderr); + fprintf (stderr, "%lx %p\n", PTR_KEY (p), p); + + if (p->sub[1]) + debug_ggc_tree (p->sub[1], indent + 1); +} - sp = &ggc_chain->strings; - s = ggc_chain->strings; - n_strings = 0; - while (s != NULL) - { - struct ggc_string *chain = s->chain; - if (! IS_MARKED (s->magic_mark)) - { - ggc_free_string (s); - *sp = chain; - n_strings++; - } - else - sp = &s->chain; - s = chain; - } - *sp = NULL; - n_strings_collected += n_strings; +#ifdef GGC_BALANCE +/* Collect tree balance metrics */ - /* The generic data. */ +#include <math.h> - ap = &ggc_chain->anys; - a = ggc_chain->anys; - n_anys = 0; - while (a != NULL) - { - struct ggc_any *chain = a->chain; - if (! IS_MARKED (a->magic_mark)) - { - ggc_free_any (a); - *ap = chain; - n_anys++; - } - else - ap = &a->chain; - a = chain; - } - n_anys_collected += n_anys; +void +debug_ggc_balance () +{ + size_t nleaf, sumdepth; - ggc_chain->bytes_alloced_since_gc = 0; + nleaf = sumdepth = 0; + tally_leaves (G.root, 0, &nleaf, &sumdepth); - time = get_run_time () - time; - gc_time += time; - - if (!quiet_flag) - { - time = (time + 500) / 1000; - fprintf (stderr, "%dr,%dv,%dt,%ds,%da %d.%03d}", n_rtxs, n_vecs, - n_trees, n_strings, n_anys, time / 1000, time % 1000); - } + fprintf (stderr, " {B %.2f,%.1f,%.1f}", + /* In a balanced tree, leaf/node should approach 1/2. */ + (float)nleaf / (float)G.objects, + /* In a balanced tree, average leaf depth should approach lg(n). */ + (float)sumdepth / (float)nleaf, + log ((double) G.objects) / M_LN2); } -#if 0 -/* GDB really should have a memory search function. Since this is just - for initial debugging, I won't even pretend to get the __data_start - to work on any but alpha-dec-linux-gnu. */ -static void ** -search_data(void **start, void *target) +static void +tally_leaves (x, depth, nleaf, sumdepth) + struct ggc_mem *x; + int depth; + size_t *nleaf; + size_t *sumdepth; { - extern void *__data_start[]; - void **_end = (void **)sbrk(0); - - if (start == NULL) - start = __data_start; - while (start < _end) + if (! x->sub[0] && !x->sub[1]) + { + *nleaf += 1; + *sumdepth += depth; + } + else { - if (*start == target) - return start; - start++; + if (x->sub[0]) + tally_leaves (x->sub[0], depth + 1, nleaf, sumdepth); + if (x->sub[1]) + tally_leaves (x->sub[1], depth + 1, nleaf, sumdepth); } - return NULL; } #endif diff --git a/gcc/ggc.h b/gcc/ggc.h index 92b29f1f0e7..b2cfb279a5c 100644 --- a/gcc/ggc.h +++ b/gcc/ggc.h @@ -56,34 +56,52 @@ void ggc_del_root PROTO ((void *base)); /* Mark nodes from the gc_add_root callback. These functions follow pointers to mark other objects too. */ -extern void ggc_mark_rtvec PROTO ((struct rtvec_def *)); extern void ggc_mark_tree_varray PROTO ((struct varray_head_tag *)); extern void ggc_mark_tree_hash_table PROTO ((struct hash_table *)); -extern void ggc_mark_string PROTO ((char *)); -extern void ggc_mark PROTO ((void *)); extern void ggc_mark_roots PROTO((void)); extern void ggc_mark_rtx_children PROTO ((struct rtx_def *)); +extern void ggc_mark_rtvec_children PROTO ((struct rtvec_def *)); extern void ggc_mark_tree_children PROTO ((union tree_node *)); -/* Mark the string, but only if it was allocated in collectable - memory. */ -extern void ggc_mark_string_if_gcable PROTO ((char *)); +#define ggc_mark_rtx(EXPR) \ + do { \ + rtx r__ = (EXPR); \ + if (r__ != NULL && ! ggc_set_mark (r__)) \ + ggc_mark_rtx_children (r__); \ + } while (0) + +#define ggc_mark_tree(EXPR) \ + do { \ + tree t__ = (EXPR); \ + if (t__ != NULL && ! ggc_set_mark (t__)) \ + ggc_mark_tree_children (t__); \ + } while (0) -#define ggc_mark_rtx(RTX_EXPR) \ - do { \ - rtx r__ = (RTX_EXPR); \ - if (r__ != NULL && ! ggc_set_mark_rtx (r__)) \ - ggc_mark_rtx_children (r__); \ +#define ggc_mark_rtvec(EXPR) \ + do { \ + rtvec v__ = (EXPR); \ + if (v__ != NULL && ! ggc_set_mark (v__)) \ + ggc_mark_rtvec_children (v__); \ } while (0) -#define ggc_mark_tree(TREE_EXPR) \ - do { \ - tree t__ = (TREE_EXPR); \ - if (t__ != NULL && ! ggc_set_mark_tree (t__)) \ - ggc_mark_tree_children (t__); \ +#define ggc_mark_string(EXPR) \ + do { \ + char *s__ = (EXPR); \ + if (s__ != NULL) \ + ggc_set_mark (s__); \ } while (0) +#define ggc_mark(EXPR) \ + do { \ + void *a__ = (EXPR); \ + if (a__ != NULL) \ + ggc_set_mark (a__); \ + } while (0) + +/* Mark, but only if it was allocated in collectable memory. */ +extern void ggc_mark_if_gcable PROTO ((void *)); + /* A GC implementation must provide these functions. */ /* Initialize the garbage collector. */ @@ -98,24 +116,35 @@ extern void ggc_push_context PROTO ((void)); extern void ggc_pop_context PROTO ((void)); /* Allocation. */ -struct rtx_def *ggc_alloc_rtx PROTO ((int nslots)); -struct rtvec_def *ggc_alloc_rtvec PROTO ((int nelt)); -union tree_node *ggc_alloc_tree PROTO ((int length)); + +/* The internal primitive. */ +void *ggc_alloc_obj PROTO ((size_t, int)); + +#define ggc_alloc_rtx(NSLOTS) \ + ((struct rtx_def *) ggc_alloc_obj (sizeof (struct rtx_def) \ + + ((NSLOTS) - 1) * sizeof (rtunion), 1)) + +#define ggc_alloc_rtvec(NELT) \ + ((struct rtvec_def *) ggc_alloc_obj (sizeof (struct rtvec_def) \ + + ((NELT) - 1) * sizeof (rtx), 1)) + +#define ggc_alloc_tree(LENGTH) \ + ((union tree_node *) ggc_alloc_obj ((LENGTH), 1)) + +#define ggc_alloc(SIZE) ggc_alloc_obj((SIZE), 0) + char *ggc_alloc_string PROTO ((const char *contents, int length)); -void *ggc_alloc PROTO ((size_t)); /* Invoke the collector. This is really just a hint, but in the case of the simple collector, the only time it will happen. */ void ggc_collect PROTO ((void)); /* Actually set the mark on a particular region of memory, but don't - follow pointers. These functions are called by ggc_mark_*. They - return zero if the object was not previously marked; they return - non-zero if the object was already marked, or if, for any other - reason, pointers in this data structure should not be traversed. */ -int ggc_set_mark_rtx PROTO ((struct rtx_def *)); -int ggc_set_mark_rtvec PROTO ((struct rtvec_def *)); -int ggc_set_mark_tree PROTO ((union tree_node *)); + follow pointers. This function is called by ggc_mark_*. It + returns zero if the object was not previously marked; non-zero if + the object was already marked, or if, for any other reason, + pointers in this data structure should not be traversed. */ +int ggc_set_mark PROTO ((void *)); /* Callbacks to the languages. */ diff --git a/gcc/rtl.h b/gcc/rtl.h index 99802374928..a234b62b6cf 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -102,18 +102,15 @@ typedef struct rtx_def { #ifdef ONLY_INT_FIELDS #ifdef CODE_FIELD_BUG - unsigned int code : 15; + unsigned int code : 16; #else unsigned short code; #endif #else /* The kind of expression this is. */ - enum rtx_code code : 15; + enum rtx_code code : 16; #endif - /* Used by the garbage collector. */ - unsigned gc_mark : 1; - /* The kind of value the expression has. */ #ifdef ONLY_INT_FIELDS int mode : 8; @@ -207,7 +204,6 @@ typedef struct rtx_def typedef struct rtvec_def{ int num_elem; /* number of elements */ - int gc_mark; struct rtx_def *elem[1]; } *rtvec; diff --git a/gcc/tree.h b/gcc/tree.h index f66a5ec7497..0c181a4e87b 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -203,9 +203,7 @@ struct tree_common unsigned lang_flag_5 : 1; unsigned lang_flag_6 : 1; - unsigned gc_mark : 1; - - /* There is room for two more flags. */ + /* There is room for three more flags. */ }; /* The following table lists the uses of each of the above flags and |