hasting2 02/12/11 12:48:02 Modified: live/gcc3 Tag: fearless-kitty-branch GNUmakefile build_gcc live/gcc3/gcc Tag: fearless-kitty-branch Makefile.in calls.c cppinit.c cpplib.c cse.c dmp-tree.c dwarf2out.c explow.c expr.c function.c genindex.c global.c regrename.c reload1.c stor-layout.c toplev.c unwind-dw2.c unwind.inc varray.c version.c live/gcc3/gcc/config Tag: fearless-kitty-branch darwin.c darwin.h live/gcc3/gcc/config/i386 Tag: fearless-kitty-branch i386.c i386.h live/gcc3/gcc/cp Tag: fearless-kitty-branch call.c mangle.c optimize.c live/gcc3/gcc/objc Tag: fearless-kitty-branch lang-specs.h objc-act.c live/gcc3/gcc/pfe Tag: fearless-kitty-branch cp-freeze-thaw.c pfe-header.c pfe-mem.c pfe.c Added: live/gcc3/gcc/testsuite/g++.dg Tag: fearless-kitty-branch preserve-PPC-CR.C live/gcc3/gcc/testsuite/objc++.dg Tag: fearless-kitty-branch super-class-1.mm live/gcc3/gcc/testsuite/objc.dg Tag: fearless-kitty-branch super-class-2.m Log: Merge changes from dizzy-kitty-branch (gcc3-120x) into fearless-kitty-branch (gcc3-11xx). Electron candidate. Tagged gcc3-1207. Revision Changes Path No revision No revision 1.28.2.1 +6 -0 src/live/gcc3/GNUmakefile Index: GNUmakefile =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/GNUmakefile,v retrieving revision 1.28 retrieving revision 1.28.2.1 diff -u -r1.28 -r1.28.2.1 --- GNUmakefile 2002/06/29 06:41:42 1.28 +++ GNUmakefile 2002/12/11 20:47:36 1.28.2.1 @@ -157,6 +157,11 @@ DO_HDR_SYMLINKS = no +# OPTIMIZE controls the optimization level we build the compiler +# with. The default is "yes", which is synomous with -O2. + +OPTIMIZE = + ####################################################################### install: installhdrs build install_no_src # libkeymgr @@ -246,6 +251,7 @@ --targets="$(TARGETS)" \ --prefix="$(PREFIX)" \ --symlinks=$(DO_SYMLINKS) \ + --optimize="$(OPTIMIZE)" \ $(ENABLE_CHECKING1) \ $(BOOTSTRAP) 1.56.2.1 +72 -10 src/live/gcc3/build_gcc Index: build_gcc =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/build_gcc,v retrieving revision 1.56 retrieving revision 1.56.2.1 diff -u -r1.56 -r1.56.2.1 --- build_gcc 2002/06/28 01:37:15 1.56 +++ build_gcc 2002/12/11 20:47:36 1.56.2.1 @@ -120,7 +120,8 @@ "DSTROOT = $DSTROOT" \ "RC_RELEASE = $RC_RELEASE" \ "VERSION = $CCVERS" \ - "CFLAGS = `echo \"$OPT_OVERRIDE $CFLAGS\" | sed -e 's/^[ ]*//'`" \ + "CFLAGS = `echo \"$CFLAGS\" | sed -e 's/^[ ]*//'`" \ + "OPT_OVERRIDE = $OPT_OVERRIDE" \ "NEXT_ROOT = $NEXT_ROOT" \ "BUILD = $BUILD" \ "BOOTSTRAP = $BOOTSTRAP" \ @@ -366,10 +367,18 @@ DO_SYMLINKS=`echo $arg | sed 's/-*s[a-z]*=//'` ;; --optimize=*) - if [ `echo $arg | sed 's/-*o[a-z]*=//'` = yes ]; then + OPT_OVERRIDE="`echo $arg | sed 's/-*o[a-z]*=//'`" + if [ "$OPT_OVERRIDE" = "yes" ]; then OPT_OVERRIDE=-O2 - else + elif [ "$OPT_OVERRIDE" = "no" ]; then OPT_OVERRIDE=-O0 + elif [ "$OPT_OVERRIDE" ]; then + OPT_OVERRIDE="`echo $OPT_OVERRIDE | grep '[-]O[0-3s]'`" + if [ ! "$OPT_OVERRIDE" ]; then + echo 'Invalid --optimize setting: '"$OPT_OVERRIDE" + echo "Expected yes, no, -On where n = 0, 1, 2, 3, or s." + exit 1 + fi fi ;; --no-optimize) @@ -456,6 +465,12 @@ # ppc cross compiler when we don't have the ppc native compiler). # HOSTS=`echo $HOSTS | fgrep "$arch" >/dev/null && echo -n "$arch "; echo $HOSTS | sed "s/$arch//"` + + # + # Do the same for the targets too so that nested loops of all the hosts + # and targets are in a predictible order. + # + TARGETS=`echo $TARGETS | fgrep "$arch" >/dev/null && echo -n "$arch "; echo $TARGETS | sed "s/$arch//"` } ############################################################################# @@ -614,7 +629,7 @@ HOST_CC="${NEXT_ROOT:+NEXT_ROOT=} cc -arch $buildhost -no-cpp-precomp" \ CFLAGS="$OPT_OVERRIDE $CFLAGS" \ GCC_CFLAGS="-no-cpp-precomp $CFLAGS" \ - BOOT_CFLAGS="-O2 $OPT_OVERRIDE $CFLAGS -no-cpp-precomp" \ + BOOT_CFLAGS="${OPT_OVERRIDE:--O2} $CFLAGS -no-cpp-precomp" \ CC="cc $hosts -no-cpp-precomp $CFLAGS" status=$? $SET +x @@ -628,10 +643,42 @@ # build_compiler() { - local no_boot_opt_flag + local no_boot_opt_flag HOST_CC buildhost=$arch + # + # If the arch is a ppc (i.e., we're building the compilers ona a ppc) and + # we are building both the i386 host and targets we want to use the ppc + # compiler we build first for the ppc host to build the i386 compilers. + # Here's a summary of who builds what: + # + # target + # ppc | i386 + # =====+===================================+===================================+ + # ppc | cc -> cc-ppc-on-ppc | cc-ppc-on-ppc -> cc-i386-on-ppc | + # host -----+-----------------------------------+-----------------------------------+ + # i386 | cc-i386-on-ppc -> cc-ppc-on-i386 | cc-i386-on-ppc -> cc-i386-on-i386 | + # -----+-----------------------------------+-----------------------------------+ + # + # In other words use the system installed cc compiler to build cc-ppc-on-ppc, + # cc-ppc-on-ppc to build cc-i386-on-ppc, and cc-i386-on-ppc to build both native + # i386 compilers. + # + # Similarly if the arch is i386 we have, + # + # target + # i386 | ppc + # =====+===================================+===================================+ + # i386 | cc -> cc-i386-on-i386 | cc-i386-on-i386 -> cc-ppc-on-i386 | + # host -----+-----------------------------------+-----------------------------------+ + # ppc | cc-ppc-on-i386 -> cc-i386-on-ppc | cc-ppc-on-i386 -> cc-ppc-on-ppc | + # -----+-----------------------------------+-----------------------------------+ + # + # Note that both $HOSTS and $TARGETS have been canonicalized so that build host (the + # arch) always comes first when both arch's are specified. + # + for host in $HOSTS; do for target in $TARGETS; do if [ ! "$BOOTSTRAP" -o $host != $target -o $BUILD != $host -o "$NEXT_ROOT" ]; then @@ -641,6 +688,19 @@ bootstrap=bootstrap fi + # + # Define $HOST_CC according to the above tables... + # + if [ "$buildhost" = "$host" ]; then + if [ "$host" = "$target" ]; then + HOST_CC=cc + else + HOST_CC="$OBJROOT/cc-$buildhost-on-$buildhost/xgcc -B$OBJROOT/cc-$buildhost-on-$buildhost/" + fi + else + HOST_CC="$OBJROOT/cc-$host-on-$buildhost/xgcc -B$OBJROOT/cc-$host-on-$buildhost/" + fi + $n cd $OBJROOT/cc-$target-on-$host # @@ -675,6 +735,7 @@ "buildhost = $buildhost" \ "target = $target" \ "host = $host" \ + "HOST_CC = $HOST_CC" \ "cwd = `pwd`" # @@ -698,9 +759,9 @@ BISON=bison \ CFLAGS="$no_boot_opt_flag $OPT_OVERRIDE $CFLAGS" \ GCC_CFLAGS="-no-cpp-precomp $CFLAGS" \ - BOOT_CFLAGS="-O2 $OPT_OVERRIDE $CFLAGS -no-cpp-precomp -mdynamic-no-pic" \ + BOOT_CFLAGS="${OPT_OVERRIDE:--O2} $CFLAGS -no-cpp-precomp -mdynamic-no-pic" \ BOOT_LDFLAGS= \ - CC="cc -arch $host -no-cpp-precomp ${bootstrap:+"$CFLAGS"}" + CC="$HOST_CC -arch $host -no-cpp-precomp ${bootstrap:+"$CFLAGS"}" status=$? $SET +x check_status $status "*** gnumake failed building compiler ***" @@ -1060,10 +1121,11 @@ HOST_PREFIX="$arch-" \ HOST_PREFIX_1="$arch-" \ HOST_CC="cc -arch $arch -no-cpp-precomp" \ - CFLAGS="-O2 $OPT_OVERRIDE $CFLAGS" \ + CFLAGS="${OPT_OVERRIDE:--O2} $CFLAGS" \ AR_FOR_TARGET=ar \ CC="cc -arch $host -no-cpp-precomp" \ LIBGCC2_INCLUDES=-I$SRCROOT/gcc/cp/inc \ + LIBGCC2_OPT="${OPT_OVERRIDE:--O2}" \ TARGET_LIBGCC2_CFLAGS="-DIN_GCC \ -DPRIVATE_EXTERN=__private_extern__ \ -DPRIVATE_EXTERN_ASM_OP=\\\".private_extern\\\" \ @@ -1136,8 +1198,8 @@ $SET -x $n gnumake CC=$OBJROOT/cc-$target-on-$arch/xgcc \ CXX=$OBJROOT/cc-$target-on-$arch/g++ \ - CFLAGS="-arch $target -no-cpp-precomp -B$OBJROOT/cc-$target-on-$arch/ -O2 $OPT_OVERRIDE $CFLAGS" \ - CXXFLAGS="-arch $target -B$OBJROOT/cc-$target-on-$arch/ -O2 $OPT_OVERRIDE $CFLAGS" + CFLAGS="-arch $target -no-cpp-precomp -B$OBJROOT/cc-$target-on-$arch/ ${OPT_OVERRIDE:--O2} $CFLAGS" \ + CXXFLAGS="-arch $target -B$OBJROOT/cc-$target-on-$arch/ ${OPT_OVERRIDE:--O2} $CFLAGS" status=$? $SET +x check_status $status "*** gnumake failed building libstdc++-v3 ***" No revision No revision 1.118.2.1 +11 -39 src/live/gcc3/gcc/Makefile.in Index: Makefile.in =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/Makefile.in,v retrieving revision 1.118 retrieving revision 1.118.2.1 diff -u -r1.118 -r1.118.2.1 --- Makefile.in 2002/06/26 23:08:49 1.118 +++ Makefile.in 2002/12/11 20:47:37 1.118.2.1 @@ -363,11 +363,14 @@ # Options to use when compiling libgcc2.a. # LIBGCC2_DEBUG_CFLAGS = -g -LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED @inhibit_libc@ +# APPLE LOCAL control opt level. ilr +LIBGCC2_CFLAGS = $(LIBGCC2_OPT) $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED @inhibit_libc@ # Additional options to use when compiling libgcc2.a. # Some targets override this to -isystem include LIBGCC2_INCLUDES = +# APPLE LOCAL control opt level. ilr +LIBGCC2_OPT = -O2 # Additional target-dependent options for compiling libgcc2.a. TARGET_LIBGCC2_CFLAGS = @@ -505,16 +508,8 @@ # Allow to override xmalloc & free with PFE memory management routines using PFE_MALLOC PFE = @enable_pfe@ ifeq ($(PFE),yes) -# Note: When changing the value of USE_SCALABLE_MALLOC make sure that -# pfe.c gets recompiled (by removing pfe.o or touching pfe.c). -USE_SCALABLE_MALLOC = 0 -ifeq ($(USE_SCALABLE_MALLOC),1) -PFE_MEM_OBJS = pfe/memmgr/scalable_malloc.o -PFE_MEM_H = $(PFE_DIR)/memmgr/scalable_malloc.h -else PFE_MEM_OBJS = pfe/pfe-mem.o PFE_MEM_H = $(PFE_DIR)/pfe-mem.h -endif PFE_OBJS = pfe/pfe.o pfe/pfe-header.o pfe/freeze-thaw.o pfe/pfedbg.o \ $(PFE_MEM_OBJS) PFE_C_AND_OBJC_OBJS = pfe/c-common-freeze-thaw.o pfe/c-freeze-thaw.o @@ -530,7 +525,7 @@ #PFE_REALLOC = pfe_realloc #PFE_FREE = pfe_free #PFE_SAVESTRING = pfe_savestring -ALL_PFE_OBJS = pfe/*$(objext) pfe/memmgr/*$(objext) +ALL_PFE_OBJS = pfe/*$(objext) #PFE_VARRAY = STRINGX((pfe)) # '(' indicates to varray code to use pfe memory else PFE_MEM_OBJS = @@ -1784,52 +1779,27 @@ genindex.o : config.h $(SYSTEM_H) genindex.h stub-genindex.o : config.h $(SYSTEM_H) genindex.h -# Use default build rule whenever possible. However, three pfe -# files have explicit build rules because... -# pfe.c Uniquely references scalable_malloc.h. -# scalable_malloc.c More-or-less compiler independent with specific needs. +# Use default build rule whenever possible. However, several pfe +# files have explicit build rules... # stub-pfe.o Stub for various compiler build tools which is # includes config.h but doesn't need insn-codes.h # and insn-flags.h included by config.h. Defining # GENERATOR_FILE explicitly suppresses these includes. -# Note, because there is a scalable_malloc in the system we rename some -# external routines from here with -D's simply to supress a bunch of -# multiple definition warnings from the linker. Here's the renames: - -MALLOC_RENAMES = -Dszone_check_counter=pfe_szone_check_counter \ - -Dszone_check_start=pfe_szone_check_start \ - -Dszone_check_modulo=pfe_szone_check_modulo \ - -Dcreate_scalable_zone=pfe_create_scalable_zone \ - -Dscalable_zone_info=pfe_scalable_zone_info - pfe/pfe.o: $(PFE_DIR)/pfe.c $(PFE_H) $(PFE_MEM_H) \ $(GCONFIG_H) $(SYSTEM_H) $(PFE_HEADER_H) $(TIMEVAR_H) $(TM_P_H) \ $(MACHMODE_H) langhooks.h $(CC) -c -no-cpp-precomp $(INTERNAL_CFLAGS) $(CFLAGS) -DHAVE_CONFIG_H \ $(ALL_CPPFLAGS) -DGENERATOR_FILE \ - -DUSE_APPLE_SCALABLE_MALLOC=$(USE_SCALABLE_MALLOC) \ - $(INCLUDES) -I$(PFE_DIR)/memmgr $(MALLOC_RENAMES) \ + $(INCLUDES) \ $(PFE_DIR)/pfe.c -o pfe/pfe.o -pfe/memmgr/scalable_malloc.o: $(PFE_DIR)/memmgr/scalable_malloc.c \ - $(PFE_DIR)/memmgr/scalable_malloc.h \ - $(PFE_DIR)/memmgr/pthread_internals.h \ - $(PFE_DIR)/memmgr/pthread_machdep.h \ - $(PFE_DIR)/memmgr/posix_sched.h \ - $(PFE_H) \ - $(GCONFIG_H) $(SYSTEM_H) - $(CC) -c -no-cpp-precomp $(INTERNAL_CFLAGS) $(CFLAGS) -DHAVE_CONFIG_H \ - $(ALL_CPPFLAGS) -DGENERATOR_FILE \ - $(INCLUDES) -I$(PFE_DIR)/memmgr $(MALLOC_RENAMES) \ - $(PFE_DIR)/memmgr/scalable_malloc.c -o pfe/memmgr/scalable_malloc.o - pfe/pfe-mem.o: $(PFE_DIR)/pfe-mem.c \ $(PFE_DIR)/pfe-mem.h \ $(GCONFIG_H) $(SYSTEM_H) $(CC) -c -no-cpp-precomp $(INTERNAL_CFLAGS) $(CFLAGS) -DHAVE_CONFIG_H \ $(ALL_CPPFLAGS) -DGENERATOR_FILE \ - $(INCLUDES) $(MALLOC_RENAMES) \ + $(INCLUDES) \ $(PFE_DIR)/pfe-mem.c -o pfe/pfe-mem.o pfe/stub-pfe.o: $(PFE_DIR)/stub-pfe.c $(PFE_H) $(PFE_HEADER_H) $(GCONFIG_H) $(SYSTEM_H) @@ -2278,8 +2248,10 @@ tradcpp.o tradcif.o mkdeps.o cppdefault.o version.o intl.o $(LIBS) tradcpp.o: tradcpp.c $(CONFIG_H) $(SYSTEM_H) version.h cppdefault.h tradcpp.h +# APPLE LOCAL: tradcifdir tradcif.o: $(tradcifdir)/tradcif.c $(CONFIG_H) $(SYSTEM_H) tradcpp.h +# APPLE LOCAL: tradcifdir $(tradcifdir)/tradcif.c: $(srcdir)/tradcif.y (cd $(tradcifdir) && $(BISON) $(BISONFLAGS) -o tr$$$$.c $(srcdir)/tradcif.y && \ mv -f tr$$$$.c tradcif.c) 1.30.4.2 +0 -1 src/live/gcc3/gcc/calls.c Index: calls.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/calls.c,v retrieving revision 1.30.4.1 retrieving revision 1.30.4.2 diff -u -r1.30.4.1 -r1.30.4.2 --- calls.c 2002/07/27 15:50:52 1.30.4.1 +++ calls.c 2002/12/11 20:47:37 1.30.4.2 @@ -3474,7 +3474,6 @@ } /* APPLE LOCAL end sibcall 3007352 */ - /* If something prevents making this a sibling call, zero out the sequence. */ if (sibcall_failure) 1.57.2.1 +1 -1 src/live/gcc3/gcc/cppinit.c Index: cppinit.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/cppinit.c,v retrieving revision 1.57 retrieving revision 1.57.2.1 diff -u -r1.57 -r1.57.2.1 --- cppinit.c 2002/06/04 21:32:35 1.57 +++ cppinit.c 2002/12/11 20:47:38 1.57.2.1 @@ -593,7 +593,7 @@ /* APPLE LOCAL end -Wpragma-once 2001-08-01 sts */ /* APPLE LOCAL begin -Wextra-tokens 2001-08-01 sts */ /* Suppress warnings about extra tokens after #endif etc. */ - CPP_OPTION (pfile, warn_extra_tokens) = 0; + CPP_OPTION (pfile, warn_extra_tokens) = 1; /* APPLE LOCAL end -Wextra-tokens 2001-08-01 sts */ /* APPLE LOCAL begin -Wnewline-eof 2001-08-23 sts */ /* Suppress warnings about missing newlines at ends of files. */ 1.32.4.2 +10 -0 src/live/gcc3/gcc/cpplib.c Index: cpplib.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/cpplib.c,v retrieving revision 1.32.4.1 retrieving revision 1.32.4.2 diff -u -r1.32.4.1 -r1.32.4.2 --- cpplib.c 2002/09/17 22:21:07 1.32.4.1 +++ cpplib.c 2002/12/11 20:47:38 1.32.4.2 @@ -1708,6 +1708,16 @@ { if (*find_answer (node, new_answer)) { + /* APPLE LOCAL begin PFE */ + /* This is a sledgehammer, since it suppresses a legit + complaint in "--load-pch foo -Abar=baz -Abar=baz", + but the whole assert feature is deprecated, and we + only care because some configs are wired to pass some + of these, and unlike macros, identical dups are not + accepted silently. */ + if (pfe_operation == PFE_LOAD && pfe_is_cmd_ln_processing ()) + return; + /* APPLE LOCAL end PFE */ cpp_warning (pfile, "\"%s\" re-asserted", NODE_NAME (node) + 1); return; } 1.24.4.1 +4 -0 src/live/gcc3/gcc/cse.c Index: cse.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/cse.c,v retrieving revision 1.24 retrieving revision 1.24.4.1 diff -u -r1.24 -r1.24.4.1 --- cse.c 2002/03/14 07:28:50 1.24 +++ cse.c 2002/12/11 20:47:38 1.24.4.1 @@ -1216,7 +1216,11 @@ reg_in_table was last set, that means that the entire register has been set before, so discard anything memorized for the entire register, including all SUBREG expressions. */ +#if 0 /* APPLE LOCAL start 3058898 */ if (REG_IN_TABLE (i) != REG_TICK (i) - 1) +#else + if (1) +#endif /* APPLE LOCAL end 3058898 */ remove_invalid_refs (i); else remove_invalid_subreg_refs (i, SUBREG_BYTE (x), GET_MODE (x)); 1.62.2.1 +1 -1 src/live/gcc3/gcc/dmp-tree.c Index: dmp-tree.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/dmp-tree.c,v retrieving revision 1.62 retrieving revision 1.62.2.1 diff -u -r1.62 -r1.62.2.1 --- dmp-tree.c 2002/06/28 19:58:42 1.62 +++ dmp-tree.c 2002/12/11 20:47:39 1.62.2.1 @@ -177,7 +177,7 @@ #include <limits.h> #include "langhooks.h" -/* c-common.h defines a macro called c-common.h. But we need to use it +/* c-common.h defines a macro called RETURN_EXPR. But we need to use it as the enum defined by tree.def. */ #undef RETURN_EXPR 1.43.2.1 +1 -1 src/live/gcc3/gcc/dwarf2out.c Index: dwarf2out.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/dwarf2out.c,v retrieving revision 1.43 retrieving revision 1.43.2.1 diff -u -r1.43 -r1.43.2.1 --- dwarf2out.c 2002/06/30 02:40:36 1.43 +++ dwarf2out.c 2002/12/11 20:47:39 1.43.2.1 @@ -202,8 +202,8 @@ unsigned explicit : 1; unsigned public : 1; unsigned private_extern : 1; - unsigned all_throwers_are_sibcalls : 1; #endif + unsigned all_throwers_are_sibcalls : 1; /* APPLE LOCAL end C++ EH */ unsigned nothrow : 1; unsigned uses_eh_lsda : 1; 1.10.4.1 +5 -1 src/live/gcc3/gcc/explow.c Index: explow.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/explow.c,v retrieving revision 1.10 retrieving revision 1.10.4.1 diff -u -r1.10 -r1.10.4.1 --- explow.c 2002/03/14 07:28:54 1.10 +++ explow.c 2002/12/11 20:47:40 1.10.4.1 @@ -1062,7 +1062,11 @@ } if (sa != 0) - sa = validize_mem (sa); + { + sa = validize_mem (sa); + emit_insn (gen_rtx_CLOBBER (VOIDmode, + gen_rtx_MEM (BLKmode, stack_pointer_rtx))); + } if (after) { 1.50.4.1 +18 -0 src/live/gcc3/gcc/expr.c Index: expr.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/expr.c,v retrieving revision 1.50 retrieving revision 1.50.4.1 diff -u -r1.50 -r1.50.4.1 --- expr.c 2002/05/14 00:48:04 1.50 +++ expr.c 2002/12/11 20:47:40 1.50.4.1 @@ -3359,6 +3359,10 @@ #endif /* PUSH_ROUNDING */ { rtx target; + /* APPLE LOCAL passing big structs by value */ +#ifdef MASK_ACCUMULATE_OUTGOING_ARGS + int saved_ACCUMULATE_OUTGOING_ARGS; +#endif /* Otherwise make space on the stack and copy the data to the address of that space. */ @@ -3458,6 +3462,13 @@ } } + /* APPLE LOCAL start passing big structs by value */ +#ifdef MASK_ACCUMULATE_OUTGOING_ARGS + saved_ACCUMULATE_OUTGOING_ARGS = ACCUMULATE_OUTGOING_ARGS; + target_flags &= ~MASK_ACCUMULATE_OUTGOING_ARGS; +#endif + /* APPLE LOCAL end passing big structs by value */ + if (!ACCUMULATE_OUTGOING_ARGS) { /* If the source is referenced relative to the stack pointer, @@ -3487,6 +3498,13 @@ TYPE_MODE (integer_type_node)); #endif OK_DEFER_POP; + + /* APPLE LOCAL start passing big structs by value */ +#ifdef MASK_ACCUMULATE_OUTGOING_ARGS + if (saved_ACCUMULATE_OUTGOING_ARGS) + target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS; +#endif + /* APPLE LOCAL end passing big structs by value */ } } else if (partial > 0) 1.42.4.2 +3 -2 src/live/gcc3/gcc/function.c Index: function.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/function.c,v retrieving revision 1.42.4.1 retrieving revision 1.42.4.2 diff -u -r1.42.4.1 -r1.42.4.2 --- function.c 2002/07/27 15:50:51 1.42.4.1 +++ function.c 2002/12/11 20:47:40 1.42.4.2 @@ -3192,10 +3192,11 @@ /* Don't even consider working with paradoxical subregs, or the moral equivalent seen here. */ if (size_x <= size_sub -/* APPLE LOCAL Altivec; don't generate subregs of vectors */ + /* APPLE LOCAL begin AltiVec */ + /* don't generate subregs of vectors */ && GET_MODE_CLASS (GET_MODE (sub)) != MODE_VECTOR_INT && GET_MODE_CLASS (GET_MODE (sub)) != MODE_VECTOR_FLOAT -/* APPLE LOCAL end */ + /* APPLE LOCAL end */ && int_mode_for_mode (GET_MODE (sub)) != BLKmode) { /* Do a bitfield insertion to mirror what would happen 1.16.2.2 +2 -0 src/live/gcc3/gcc/genindex.c Index: genindex.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/genindex.c,v retrieving revision 1.16.2.1 retrieving revision 1.16.2.2 diff -u -r1.16.2.1 -r1.16.2.2 --- genindex.c 2002/09/17 22:21:06 1.16.2.1 +++ genindex.c 2002/12/11 20:47:41 1.16.2.2 @@ -232,6 +232,8 @@ if (!flag_debug_gen_index) if (close (index_socket_fd) < 0) warning ("cannot close the indexing data socket"); + if (flag_check_indexed_header_list) + write_indexed_header_list (); } char *index_buffer = NULL; 1.6.4.1 +66 -9 src/live/gcc3/gcc/global.c Index: global.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/global.c,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -u -r1.6 -r1.6.4.1 --- global.c 2002/03/22 01:21:24 1.6 +++ global.c 2002/12/11 20:47:41 1.6.4.1 @@ -36,6 +36,14 @@ #include "output.h" #include "toplev.h" +/* APPLE LOCAL begin rewrite weight computation */ +/* The rewritten weight computation works fine on Darwin, but causes + bootstrap compares to fail on Linux. */ +#ifdef CONFIG_DARWIN_H +#define REWRITE_WEIGHT_COMPUTATION +#endif +/* APPLE LOCAL end rewrite weight computation */ + /* This pass of the compiler performs global register allocation. It assigns hard register numbers to all the pseudo registers that were not handled in local_alloc. Assignments are recorded @@ -223,7 +231,8 @@ static int local_reg_n_refs[FIRST_PSEUDO_REGISTER]; -/* APPLE LOCAL rewrite weight computation */ +/* APPLE LOCAL begin rewrite weight computation */ +#ifdef REWRITE_WEIGHT_COMPUTATION /* Overall weight of each hard reg, as used by local alloc. This was formerly computed once as SUM(REG_FREQ(i))/SUM(REG_LIVE_LENGTH(i)) where the sums @@ -233,8 +242,17 @@ SUM (REG_FREQ(i)/REG_LIVE_LENGTH(i)) over all uses. */ static double local_reg_weight[FIRST_PSEUDO_REGISTER]; -/* APPLE LOCAL end */ +#else +/* Frequency of uses of given hard reg. */ +static int local_reg_freq[FIRST_PSEUDO_REGISTER]; + +/* Guess at live length of each hard reg, as used by local alloc. + This is actually the sum of the live lengths of the specific regs. */ +static int local_reg_live_length[FIRST_PSEUDO_REGISTER]; +#endif /* REWRITE_WEIGHT_COMPUTATION */ +/* APPLE LOCAL end rewrite weight computation */ + /* Test a bit in TABLE, a vector of HARD_REG_SETs, for vector element I, and hard register number J. */ @@ -465,9 +483,17 @@ /* Calculate amount of usage of each hard reg by pseudos allocated by local-alloc. This is to see if we want to override it. */ - /* APPLE LOCAL rewrite weight computation */ + /* APPLE LOCAL begin rewrite weight computation */ +#ifndef REWRITE_WEIGHT_COMPUTATION + memset ((char *) local_reg_live_length, 0, sizeof local_reg_live_length); +#endif /* REWRITE_WEIGHT_COMPUTATION */ memset ((char *) local_reg_n_refs, 0, sizeof local_reg_n_refs); +#ifdef REWRITE_WEIGHT_COMPUTATION memset ((char *) local_reg_weight, 0, sizeof local_reg_weight); +#else + memset ((char *) local_reg_freq, 0, sizeof local_reg_freq); +#endif /* REWRITE_WEIGHT_COMPUTATION */ + /* APPLE LOCAL end rewrite weight computation */ for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++) if (reg_renumber[i] >= 0) { @@ -477,19 +503,30 @@ for (j = regno; j < endregno; j++) { - /* APPLE LOCAL rewrite weight computation */ local_reg_n_refs[j] += REG_N_REFS (i); + /* APPLE LOCAL begin rewrite weight computation */ +#ifdef REWRITE_WEIGHT_COMPUTATION if ( REG_LIVE_LENGTH (i) > 0 ) local_reg_weight[j] += (double)REG_FREQ (i) / (double) REG_LIVE_LENGTH (i); +#else + local_reg_freq[j] += REG_FREQ (i); + local_reg_live_length[j] += REG_LIVE_LENGTH (i); +#endif /* REWRITE_WEIGHT_COMPUTATION */ + /* APPLE LOCAL end rewrite weight computation */ } } /* We can't override local-alloc for a reg used not just by local-alloc. */ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) if (regs_ever_live[i]) - /* APPLE LOCAL rewrite weight computation */ + /* APPLE LOCAL begin rewrite weight computation */ +#ifdef REWRITE_WEIGHT_COMPUTATION local_reg_n_refs[i] = 0; +#else + local_reg_n_refs[i] = 0, local_reg_freq[i] = 0; +#endif /* REWRITE_WEIGHT_COMPUTATION */ + /* APPLE LOCAL end rewrite weight computation */ allocno_row_words = (max_allocno + INT_BITS - 1) / INT_BITS; @@ -1226,16 +1263,32 @@ #endif ) { - /* APPLE LOCAL rewrite weight computation */ + /* APPLE LOCAL begin rewrite weight computation */ +#ifdef REWRITE_WEIGHT_COMPUTATION /* We explicitly evaluate the divide result into a temporary variable so as to avoid excess precision problems that occur on an i386-unknown-sysv4.2 (unixware) host. */ - double tmp = ((double) allocno[num].freq + / allocno[num].live_length); +#else + /* APPLE LOCAL end rewrite weight computation */ + /* We explicitly evaluate the divide results into temporary + variables so as to avoid excess precision problems that occur + on an i386-unknown-sysv4.2 (unixware) host. */ + + double tmp1 = ((double) local_reg_freq[regno] + / local_reg_live_length[regno]); + double tmp2 = ((double) allocno[num].freq / allocno[num].live_length); + /* APPLE LOCAL begin rewrite weight computation */ +#endif /* REWRITE_WEIGHT_COMPUTATION */ +#ifdef REWRITE_WEIGHT_COMPUTATION if (local_reg_weight[regno] < tmp) - /* APPLE LOCAL end */ +#else + if (tmp1 < tmp2) +#endif /* REWRITE_WEIGHT_COMPUTATION */ + /* APPLE LOCAL end rewrite weight computation */ { /* Hard reg REGNO was used less in total by local regs than it would be used by this one allocno! */ @@ -1282,7 +1335,11 @@ SET_HARD_REG_BIT (regs_used_so_far, j); /* This is no longer a reg used just by local regs. */ local_reg_n_refs[j] = 0; - /* APPLE LOCAL rewrite weight computation */ + /* APPLE LOCAL begin rewrite weight computation */ +#ifndef REWRITE_WEIGHT_COMPUTATION + local_reg_freq[j] = 0; +#endif /* REWRITE_WEIGHT_COMPUTATION */ + /* APPLE LOCAL end rewrite weight computation */ } /* For each other pseudo-reg conflicting with this one, mark it as conflicting with the hard regs this one occupies. */ 1.8.4.1 +15 -0 src/live/gcc3/gcc/regrename.c Index: regrename.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/regrename.c,v retrieving revision 1.8 retrieving revision 1.8.4.1 diff -u -r1.8 -r1.8.4.1 --- regrename.c 2002/04/04 07:13:37 1.8 +++ regrename.c 2002/12/11 20:47:41 1.8.4.1 @@ -1294,6 +1294,13 @@ enum machine_mode orig_mode, new_mode; unsigned int regno ATTRIBUTE_UNUSED; { +/* APPLE LOCAL */ +#ifdef TARGET_POWERPC + /* This arises from FLOAT_EXTEND which is really a NOP. */ + if (orig_mode == SFmode && new_mode == DFmode) + return true; +#endif + if (GET_MODE_SIZE (orig_mode) < GET_MODE_SIZE (new_mode)) return false; @@ -1709,6 +1716,14 @@ /* Notice copies. */ if (set && REG_P (SET_DEST (set)) && REG_P (SET_SRC (set))) copy_value (SET_DEST (set), SET_SRC (set), vd); +/* APPLE LOCAL */ +#ifdef TARGET_POWERPC + /* FLOAT_EXTEND is actually a copy; record that too. */ + if (set && REG_P (SET_DEST (set)) + && GET_CODE (SET_SRC (set)) == FLOAT_EXTEND + && REG_P (XEXP (SET_SRC (set), 0))) + copy_value (SET_DEST (set), XEXP (SET_SRC (set), 0), vd); +#endif if (insn == bb->end) break; 1.18.4.1 +3 -0 src/live/gcc3/gcc/reload1.c Index: reload1.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/reload1.c,v retrieving revision 1.18 retrieving revision 1.18.4.1 diff -u -r1.18 -r1.18.4.1 --- reload1.c 2002/04/21 00:59:09 1.18 +++ reload1.c 2002/12/11 20:47:42 1.18.4.1 @@ -1184,6 +1184,7 @@ /* Make a pass over all the insns and delete all USEs which we inserted only to tag a REG_EQUAL note on them. Remove all REG_DEAD and REG_UNUSED notes. Delete all CLOBBER insns that don't refer to the return value + or to memory (memory CLOBBERs must be kept around for scheduler dependencies) and simplify (subreg (reg)) operands. Also remove all REG_RETVAL and REG_LIBCALL notes since they are no longer useful or accurate. Strip and regenerate REG_INC notes that may have been moved around. */ @@ -1203,6 +1204,8 @@ && (GET_MODE (insn) == QImode || find_reg_note (insn, REG_EQUAL, NULL_RTX))) || (GET_CODE (PATTERN (insn)) == CLOBBER + && (GET_CODE (XEXP (PATTERN (insn), 0)) != MEM + || GET_MODE (XEXP (PATTERN (insn), 0)) != BLKmode) && (GET_CODE (XEXP (PATTERN (insn), 0)) != REG || ! REG_FUNCTION_VALUE_P (XEXP (PATTERN (insn), 0))))) { 1.27.2.1 +4 -0 src/live/gcc3/gcc/stor-layout.c Index: stor-layout.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/stor-layout.c,v retrieving revision 1.27 retrieving revision 1.27.2.1 diff -u -r1.27 -r1.27.2.1 --- stor-layout.c 2002/06/03 22:10:54 1.27 +++ stor-layout.c 2002/12/11 20:47:42 1.27.2.1 @@ -1297,7 +1297,9 @@ RECORD_TYPE. This does not apply to unions. */ if (TREE_CODE (type) == RECORD_TYPE && mode != VOIDmode) TYPE_MODE (type) = mode; +#if defined(MASK_POWERPC) && defined(TARGET_MACHO) /* APPLE LOCAL 8-byte-struct hack */ +#if defined RS6000_VARARGS_AREA /* Make 8-byte structs BLKmode instead of DImode, which fixes both struct-return methods and attempts to use floats in kernel code. This should probably become a generic macro similar to @@ -1305,7 +1307,9 @@ else if (mode_for_size_tree (TYPE_SIZE (type), MODE_INT, 1) == DImode && flag_pic) ; +#endif else +#endif /* defined(MASK_POWERPC) && defined(TARGET_MACHO) */ TYPE_MODE (type) = mode_for_size_tree (TYPE_SIZE (type), MODE_INT, 1); /* If structure's known alignment is less than what the scalar 1.136.2.9 +24 -10 src/live/gcc3/gcc/toplev.c Index: toplev.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/toplev.c,v retrieving revision 1.136.2.8 retrieving revision 1.136.2.9 diff -u -r1.136.2.8 -r1.136.2.9 --- toplev.c 2002/12/05 00:20:13 1.136.2.8 +++ toplev.c 2002/12/11 20:47:42 1.136.2.9 @@ -999,17 +999,24 @@ /* APPLE LOCAL end Pascal Strings 2001-07-12 sts */ /* APPLE LOCAL begin coalescing turly 20020319 */ +/* Don't enable coalescing by default unless we have one of these + features in cctools. */ +#if defined(APPLE_WEAK_SECTION_ATTRIBUTE) || defined(APPLE_WEAK_ASSEMBLER_DIRECTIVE) +#define COALESCE_BY_DEFAULT 1 +#else +#define COALESCE_BY_DEFAULT 0 +#endif /* Nonzero means that certain data and code items can be marked as coalesced, which is a lesser form of ELF weak symbols. */ -int flag_coalescing_enabled = 1; +int flag_coalescing_enabled = COALESCE_BY_DEFAULT; /* Nonzero means mark template instantiations as coalesced. */ -int flag_coalesce_templates = 1; +int flag_coalesce_templates = COALESCE_BY_DEFAULT; /* Nonzero means use the OS X 10.2 "weak_definitions" section attribute. If this is set, then explicit template instantiations DO NOT get coalesced, but are plain old text or data instead. */ -int flag_weak_coalesced_definitions = 1; +int flag_weak_coalesced_definitions = COALESCE_BY_DEFAULT; /* Coalesced symbols are private export by default. This EXPERIMENTAL flag will make them global instead. */ @@ -1329,6 +1336,7 @@ { "-fload=<file>", "Load precompiled header <file>"}, { "-fdump=<file>", "Dump precompiled header <file>"}, { "-fvalidate", "Validate precompiled header during load"}, + { "-fno-validate", "Do not validate precompiled header during load"}, #endif { "-Wall", @@ -2400,10 +2408,12 @@ the version of GCC which compiled this code. The format of the .ident string is patterned after the ones produced by native SVR4 compilers. */ #ifdef IDENT_ASM_OP - /* APPLE LOCAL begin PFE */ - /* Suppress all asm output when doing a PFE dump. ilr */ +/* APPLE LOCAL begin PFE */ +#ifdef PFE + /* Suppress al asm output when doing a PFE dump. ilr */ if (pfe_operation != PFE_DUMP) - /* APPLE LOCAL end PFE */ +#endif +/* APPLE LOCAL end PFE */ if (!flag_no_ident) fprintf (asm_out_file, "%s\"GCC: (GNU) %s\"\n", IDENT_ASM_OP, version_string); @@ -5057,6 +5067,8 @@ arch = (char *) "i386"; else if (strcmp (argv[i], "-fvalidate") == 0) flag_pfe_validate = 1; + else if (strcmp (argv[i], "-fno-validate") == 0) + flag_pfe_validate = 0; } if (strcmp (argv[i], "-ftime-report") == 0) @@ -5097,8 +5109,8 @@ /* APPLE LOCAL begin PFE dpatel */ #ifdef PFE /* Turn on macro validation during pfe load */ - if (pfe_operation == PFE_LOAD && flag_pfe_validate) - pfe_macro_validation = 1; + if (pfe_operation == PFE_LOAD) + pfe_macro_validation = flag_pfe_validate; #endif /* APPLE LOCAL end PFE dpatel */ @@ -5685,12 +5697,14 @@ /* Close non-debugging input and output files. Take special care to note whether fclose returns an error, since the pages might still be on the buffer chain while the file is open. */ - /* APPLE LOCAL begin PFE ff */ +/* APPLE LOCAL begin PFE ff */ +#ifdef PFE /* Make sure we don't close stdout (which asm_out_file is mapped to during a dump) so that we can write PFE diagnostics out if needed. */ if (pfe_operation != PFE_DUMP) - /* APPLE LOCAL end PFE ff */ +#endif +/* APPLE LOCAL end PFE ff */ if (asm_out_file) { if (ferror (asm_out_file) != 0) 1.15.4.1 +7 -0 src/live/gcc3/gcc/unwind-dw2.c Index: unwind-dw2.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/unwind-dw2.c,v retrieving revision 1.15 retrieving revision 1.15.4.1 diff -u -r1.15 -r1.15.4.1 --- unwind-dw2.c 2002/04/11 17:01:54 1.15 +++ unwind-dw2.c 2002/12/11 20:47:43 1.15.4.1 @@ -28,6 +28,13 @@ #include "gthr.h" /* APPLE LOCAL FSF candidate */ #include <string.h> +/* APPLE LOCAL begin log throws that trash CR */ +#include <syslog.h> +#include <stdarg.h> +int __log_cr_trashing = 0 ; +#define APPLE_LOCAL_LOG_CR_TRASHING(x) do { __log_cr_trashing = x ; } while (0) +/* APPLE LOCAL end log throws that trash CR */ + #define Dprintf if (0) printf 1.8.4.1 +2 -0 src/live/gcc3/gcc/unwind.inc Index: unwind.inc =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/unwind.inc,v retrieving revision 1.8 retrieving revision 1.8.4.1 diff -u -r1.8 -r1.8.4.1 --- unwind.inc 2002/03/16 01:16:23 1.8 +++ unwind.inc 2002/12/11 20:47:43 1.8.4.1 @@ -35,6 +35,7 @@ { _Unwind_Reason_Code code; + APPLE_LOCAL_LOG_CR_TRASHING(1); Dprintf("in _Unwind_RaiseException_Phase2\n"); while (1) { @@ -75,6 +76,7 @@ uw_update_context (context, &fs); } + APPLE_LOCAL_LOG_CR_TRASHING(0); return code; } 1.10.4.1 +14 -4 src/live/gcc3/gcc/varray.c Index: varray.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/varray.c,v retrieving revision 1.10 retrieving revision 1.10.4.1 diff -u -r1.10 -r1.10.4.1 --- varray.c 2002/03/14 07:29:10 1.10 +++ varray.c 2002/12/11 20:47:43 1.10.4.1 @@ -149,10 +149,20 @@ if (va) { - if (!USE_PFE_MEMORY (va->name)) - internal_error ("Virtual array %s was assumed to be in pfe memory and isn't", - RP (va->name)); - pfe_freeze_thaw_ptr_fp (&va->name); + if (PFE_FREEZING) + { + if (!USE_PFE_MEMORY (va->name)) + internal_error ("Virtual array %s was assumed to be in pfe memory and isn't", + RP (va->name)); + pfe_freeze_ptr (&va->name); + } + else + { + pfe_thaw_ptr (&va->name); + if (!USE_PFE_MEMORY (va->name)) + internal_error ("Virtual array %s was assumed to be in pfe memory and isn't", + RP (va->name)); + } nelts = VARRAY_ACTIVE_SIZE (va); for (i = 0; i < nelts; ++i) PFE_FREEZE_THAW_WALK (va->data.tree[i]); 1.44.2.23 +2 -2 src/live/gcc3/gcc/version.c Index: version.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/version.c,v retrieving revision 1.44.2.22 retrieving revision 1.44.2.23 diff -u -r1.44.2.22 -r1.44.2.23 --- version.c 2002/12/05 00:46:03 1.44.2.22 +++ version.c 2002/12/11 20:47:43 1.44.2.23 @@ -1,10 +1,10 @@ #include "ansidecl.h" #include "version.h" -const char *const version_string = "3.1 20020420 (prerelease)"; +const char *const version_string = "3.1 20021003 (prerelease)"; /* APPLE LOCAL begin Apple version */ /* Note that we can't say "apple_v*rs**n_str*ng" because of a cheesy grep in configure that will get very confused if we do. */ -const char *const apple_version_str = "1176"; +const char *const apple_version_str = "1207"; /* APPLE LOCAL end Apple version */ No revision No revision 1.69.2.1 +31 -8 src/live/gcc3/gcc/config/darwin.c Index: darwin.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/config/darwin.c,v retrieving revision 1.69 retrieving revision 1.69.2.1 diff -u -r1.69 -r1.69.2.1 --- darwin.c 2002/06/19 00:30:42 1.69 +++ darwin.c 2002/12/11 20:47:50 1.69.2.1 @@ -968,13 +968,13 @@ else if (GET_CODE (orig) == SYMBOL_REF) return orig; - else if (GET_CODE (orig) == PLUS - && (GET_CODE (XEXP (orig, 0)) == MEM - || GET_CODE (XEXP (orig, 0)) == SYMBOL_REF - || GET_CODE (XEXP (orig, 0)) == LABEL_REF) - && XEXP (orig, 0) != pic_offset_table_rtx - && GET_CODE (XEXP (orig, 1)) != REG) - + else if (GET_CODE (orig) == PLUS + && (GET_CODE (XEXP (orig, 0)) == MEM + || GET_CODE (XEXP (orig, 0)) == SYMBOL_REF + || GET_CODE (XEXP (orig, 0)) == LABEL_REF) + && XEXP (orig, 0) != pic_offset_table_rtx + && GET_CODE (XEXP (orig, 1)) != REG) + { rtx base; int is_complex = (GET_CODE (XEXP (orig, 0)) == MEM); @@ -987,9 +987,27 @@ pic_ref = plus_constant (base, INTVAL (orig)); is_complex = 1; } + /* APPLE LOCAL begin gen ADD */ +#ifdef MASK_80387 + else if (GET_CODE (base) == MEM) + { + pic_ref = gen_rtx (PLUS, Pmode, base, orig); + if ( ! reload_in_progress) /* necessary ? */ + { + rtx clob = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (CCmode, FLAGS_REG)); + rtx set = gen_rtx_SET (VOIDmode, reg, pic_ref); + pic_ref = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, set, clob)); + emit_insn (pic_ref); + pic_ref = reg; + is_complex = 0; + } + } +#endif else pic_ref = gen_rtx (PLUS, Pmode, base, orig); + /* APPLE LOCAL end gen ADD */ + if (RTX_UNCHANGING_P (base) && RTX_UNCHANGING_P (orig)) RTX_UNCHANGING_P (pic_ref) = 1; @@ -1009,7 +1027,12 @@ else if (GET_CODE (orig) == MEM && GET_CODE (XEXP (orig, 0)) == SYMBOL_REF) { - rtx addr = machopic_legitimize_pic_address (XEXP (orig, 0), Pmode, reg); + /* APPLE LOCAL use new pseudo for temp; reusing reg confuses PRE */ + rtx tempreg = reg; + rtx addr; + if ( !no_new_pseudos ) + tempreg = gen_reg_rtx (Pmode); + addr = machopic_legitimize_pic_address (XEXP (orig, 0), Pmode, tempreg); addr = gen_rtx (MEM, GET_MODE (orig), addr); RTX_UNCHANGING_P (addr) = RTX_UNCHANGING_P (orig); 1.168.2.3 +0 -6 src/live/gcc3/gcc/config/darwin.h Index: darwin.h =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/config/darwin.h,v retrieving revision 1.168.2.2 retrieving revision 1.168.2.3 diff -u -r1.168.2.2 -r1.168.2.3 --- darwin.h 2002/10/30 20:35:59 1.168.2.2 +++ darwin.h 2002/12/11 20:47:50 1.168.2.3 @@ -1036,12 +1036,6 @@ fputs ("\n", FILE); }} while (0) /* APPLE LOCAL end private extern */ -#if !defined(APPLE_WEAK_SECTION_ATTRIBUTE) && !defined(APPLE_WEAK_ASSEMBLER_DIRECTIVE) - #warning Neither weak attributes nor weak directives defined. - #warning Assuming weak directives. -#define APPLE_WEAK_ASSEMBLER_DIRECTIVE 1 -#endif - /* APPLE LOCAL weak definition */ #ifdef APPLE_WEAK_ASSEMBLER_DIRECTIVE #define ASM_WEAK_DEFINITIONIZE_LABEL(FILE, NAME) \ No revision No revision 1.27.2.1 +4 -203 src/live/gcc3/gcc/config/i386/i386.c Index: i386.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/config/i386/i386.c,v retrieving revision 1.27 retrieving revision 1.27.2.1 diff -u -r1.27 -r1.27.2.1 --- i386.c 2002/06/19 17:56:33 1.27 +++ i386.c 2002/12/11 20:47:52 1.27.2.1 @@ -1196,7 +1196,7 @@ if ((x86_accumulate_outgoing_args & CPUMASK) && !(target_flags & MASK_ACCUMULATE_OUTGOING_ARGS_SET) && !optimize_size) - target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS; + /* target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS * force off for 3118870 */; /* Figure out what ASM_GENERATE_INTERNAL_LABEL builds as a prefix. */ { @@ -12546,11 +12546,10 @@ } #endif +/* APPLE LOCAL begin darwin x86 */ #if TARGET_MACHO -/* apple.c: Functions for Mac OS X as target machine for GNU C compiler. */ +static int current_machopic_label_num; -static int current_machopic_label_num; /* config/apple/machopic.c */ - void machopic_output_stub (file, symb, stub) FILE *file; @@ -12610,206 +12609,8 @@ fprintf (file, "%s:\n", lazy_ptr_name); fprintf (file, "\t.indirect_symbol %s\n", symbol_name); fprintf (file, "\t.long %s\n", binder_name); -} - -#if 0 -#ifndef FIXED_PIC_REG -int pic86_reg_num = 0; -#endif - -i386_finalize_machopic () -{ - extern int current_function_uses_pic_offset_table; -#ifndef FIXED_PIC_REG - const int pic_reg = pic86_reg_num; - rtx first_insn = next_real_insn (get_insns ()); - - if (pic_reg >= FIRST_PSEUDO_REGISTER && regno_reg_rtx [pic_reg]) - pic_offset_table_rtx = regno_reg_rtx [pic_reg]; -#endif - - if (!current_function_uses_pic_offset_table) -#ifndef FIXED_PIC_REG - { -#endif - current_function_uses_pic_offset_table = - profile_flag || profile_block_flag || get_pool_size() - || current_function_uses_const_pool || const_double_used (); - - if (current_function_uses_pic_offset_table) -#ifndef FIXED_PIC_REG - { - if (!first_insn) - return; - emit_insn_before (gen_rtx (SET, VOIDmode, pic_offset_table_rtx, - gen_rtx (PC, VOIDmode)), - first_insn); - emit_insn_after (gen_rtx (USE, VOIDmode, pic_offset_table_rtx), - get_last_insn ()); - } - } - else - { - if (first_insn) - emit_insn_before (gen_rtx (USE, VOIDmode, pic_offset_table_rtx), - first_insn); -#endif - /* This is necessary. */ - if (const_double_used ()) - emit_insn_after (gen_rtx (USE, VOIDmode, pic_offset_table_rtx), - get_last_insn ()); -#ifndef FIXED_PIC_REG - } -#endif -} - -#ifndef FIXED_PIC_REG -static int replace_count, inside_set_rtx; -static -rtx -replace_machopic86_base_refs (rtx x, rtx repl) -{ - register enum rtx_code code; - register int i; - register char *fmt; - - if (x == 0) - return x; - - code = GET_CODE (x); - switch (code) - { - case SCRATCH: - case PC: - case CC0: - case CONST_INT: - case CONST_DOUBLE: - case CONST: - case SYMBOL_REF: - case LABEL_REF: - case SUBREG: - return x; - - case REG: - /* Only switch registers if we're inside a "(set ...)" rtx. */ - if (REGNO (x) == pic86_reg_num && inside_set_rtx) - { - ++replace_count; - return repl; - } - return x; - - case SET: - ++inside_set_rtx; - SET_SRC (x) = replace_machopic86_base_refs (SET_SRC (x), repl); - --inside_set_rtx; - return x; - } - - fmt = GET_RTX_FORMAT (code); - for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) - { - if (fmt[i] == 'e') - XEXP (x, i) = replace_machopic86_base_refs (XEXP (x, i), repl); - else - if (fmt[i] == 'E') - { - register int j; - for (j = 0; j < XVECLEN (x, i); j++) - XVECEXP (x, i, j) = - replace_machopic86_base_refs (XVECEXP (x, i, j), repl); - } - } - return x; -} - - -/* fixup_machopic386_pic_base_refs fixes up COUNT insns beginning with - INSNS so that references to the pic_offset_table_rtx pseudo are - replaced with the real thing. - - Only SET insns are affected. - - This is because the compiler can't handle reloading this pseudo - for reasons mightily obscure, but I think caused by the fact that - "(reg:SI 21)" appears from nowhere and has no mem or const equivalences. - - Note that passing a negative COUNT will fixup all instructions. */ - -void -fixup_machopic386_pic_base_refs (rtx insns, int count) -{ - - /* Replace all occurrences of "(reg:SI 21)" -- the PIC base register -- - if a register or memory location has been allocated for it. - I am at a loss as to why the dratted compiler can't do this itself. */ - - if (1 && flag_pic && current_function_uses_pic_offset_table - && regno_reg_rtx[pic86_reg_num] - && (( GET_CODE (regno_reg_rtx[pic86_reg_num]) != REG - || /* it is REG, but a different register */ - REGNO (regno_reg_rtx[pic86_reg_num]) != pic86_reg_num) - || (reg_renumber && reg_renumber[pic86_reg_num] >= 0))) - { - rtx replacement; - int output_hdr = 0; - - if (reg_renumber && reg_renumber[pic86_reg_num] >= 0) - replacement = gen_rtx_REG(SImode, reg_renumber[pic86_reg_num]); - else - replacement = regno_reg_rtx[pic86_reg_num]; - - for (; insns != 0 && count--; insns = next_real_insn (insns)) - { - replace_count = 0; - inside_set_rtx = 0; - insns = replace_machopic86_base_refs (insns, replacement); - if (replace_count && getenv("REPLACED_INSNS") != 0) - { - if (!output_hdr) - { - fprintf (stderr, "## %s -- replace (reg:SI %d) with ", - current_function_name, pic86_reg_num); - debug_rtx (replacement); - output_hdr = 1; - } - debug_rtx (insns); - fprintf(stderr, "\n##\n"); - } - } - } -} -#endif /* FIXED_PIC_REG */ - -/* Returns 1 if OP is a - - (const:SI (minus:SI (symbol_ref:SI ("symbol_name")) - (symbol_ref:SI ("name_of_pic_base_label")) - - i.e., a MACHOPIC pic-base-offset constant. - - This is only needed by a hacked pattern in i386.md, and does not - apply if the PIC base reg is fixed. Returning 0 here in this case - effectively disables that pattern. */ - -int -machopic_symbolic_operand (op, mode) - register rtx op; - enum machine_mode mode ATTRIBUTE_UNUSED; -{ -#ifndef FIXED_PIC_REG - if (GET_CODE (op) == CONST) - { - op = XEXP (op, 0); - if (GET_CODE (op) == MINUS) - return (GET_CODE (XEXP (op, 0)) == SYMBOL_REF - && GET_CODE (XEXP (op, 1)) == SYMBOL_REF); - } -#endif - return 0; } -#endif -#endif +#endif /* TARGET_MACHO */ /* APPLE LOCAL end darwin x86 */ /* Order the registers for register allocator. */ 1.20.4.1 +2 -1 src/live/gcc3/gcc/config/i386/i386.h Index: i386.h =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/config/i386/i386.h,v retrieving revision 1.20 retrieving revision 1.20.4.1 diff -u -r1.20 -r1.20.4.1 --- i386.h 2002/04/21 00:59:34 1.20 +++ i386.h 2002/12/11 20:47:54 1.20.4.1 @@ -108,7 +108,8 @@ /* configure can arrange to make this 2, to force a 486. */ #ifndef TARGET_CPU_DEFAULT -#define TARGET_CPU_DEFAULT 0 +/* APPLE LOCAL darwin x86 - default -mcpu=pentiumpro instead of i386 (radar 2730299) ilr */ +#define TARGET_CPU_DEFAULT 4 #endif /* Masks for the -m switches */ No revision No revision 1.31.4.3 +0 -6 src/live/gcc3/gcc/cp/call.c Index: call.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/cp/call.c,v retrieving revision 1.31.4.2 retrieving revision 1.31.4.3 diff -u -r1.31.4.2 -r1.31.4.3 --- call.c 2002/10/16 20:58:53 1.31.4.2 +++ call.c 2002/12/11 20:47:56 1.31.4.3 @@ -4408,7 +4408,6 @@ else if (flags & LOOKUP_NONVIRTUAL) { tree call_site_type = TREE_TYPE (cand->basetype_path); tree fn_class_type = DECL_CLASS_CONTEXT (fn); - my_friendly_assert (call_site_type != NULL && fn_class_type != NULL && AGGREGATE_TYPE_P (call_site_type) && @@ -4419,11 +4418,6 @@ ba_any | ba_quiet, NULL) != NULL, 20020719); - - if (TYPE_USES_MULTIPLE_INHERITANCE (call_site_type) - || TYPE_USES_VIRTUAL_BASECLASSES (call_site_type)) - cp_error_at ("Indirect virtual calls are invalid for a type that uses multiple or virtual inheritance"); - fn = (build_vfn_ref_using_vtable (call_site_type, BINFO_VTABLE (TYPE_BINFO (call_site_type)), 1.11.2.3 +18 -1 src/live/gcc3/gcc/cp/mangle.c Index: mangle.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/cp/mangle.c,v retrieving revision 1.11.2.2 retrieving revision 1.11.2.3 diff -u -r1.11.2.2 -r1.11.2.3 --- mangle.c 2002/07/13 02:48:22 1.11.2.2 +++ mangle.c 2002/12/11 20:47:56 1.11.2.3 @@ -1177,9 +1177,11 @@ write_string ("C1"); else if (DECL_BASE_CONSTRUCTOR_P (ctor)) write_string ("C2"); + /* APPLE LOCAL begin decloning */ /* This is the old-style "[unified]" constructor. */ else if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (ctor)) write_string ("C4"); + /* APPLE LOCAL end decloning */ else abort (); } @@ -1205,9 +1207,11 @@ write_string ("D1"); else if (DECL_BASE_DESTRUCTOR_P (dtor)) write_string ("D2"); + /* APPLE LOCAL begin decloning */ else if (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (dtor)) /* This is the old-style "[unified]" destructor. */ write_string ("D4"); + /* APPLE LOCAL end decloning */ else abort (); } @@ -1436,7 +1440,20 @@ case VECTOR_TYPE: write_string ("U8__vector"); - write_type (TREE_TYPE (type)); + /* APPLE LOCAL begin AltiVec */ + /* The 'vector pixel' and 'vector bool ...' types + are mangled distinctly. */ + if (type == vector_pixel_type_node) + write_string ("u7__pixel"); + else if (type == vector_boolean_char_type_node) + write_string ("U6__boolc"); + else if (type == vector_boolean_short_type_node) + write_string ("U6__bools"); + else if (type == vector_boolean_long_type_node) + write_string ("U6__booli"); + else + write_type (TREE_TYPE (type)); + /* APPLE LOCAL end AltiVec */ break; default: 1.11.2.2 +15 -5 src/live/gcc3/gcc/cp/optimize.c Index: optimize.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/cp/optimize.c,v retrieving revision 1.11.2.1 retrieving revision 1.11.2.2 diff -u -r1.11.2.1 -r1.11.2.2 --- optimize.c 2002/07/12 00:20:52 1.11.2.1 +++ optimize.c 2002/12/11 20:47:56 1.11.2.2 @@ -159,7 +159,7 @@ maybe_thunk_body (fn) tree fn; { - tree call, clone, expr_stmt, fn_parm, last_arg, start; + tree call, clone, expr_stmt, fn_parm, fn_parm_typelist, last_arg, start; int parmno, vtt_parmno; if (flag_apple_kext || flag_clone_structors) @@ -194,6 +194,9 @@ /* If we got this far, we've decided to turn the clones into thunks. */ + /* We're going to generate code for fn, so it is no longer "abstract." */ + DECL_ABSTRACT (fn) = 0; + /* Find the vtt_parm, if present. */ for (vtt_parmno = -1, parmno = 0, fn_parm = DECL_ARGUMENTS (fn); fn_parm; @@ -231,6 +234,7 @@ for (parmno = 0, parmlist = NULL, fn_parm = DECL_ARGUMENTS (fn), + fn_parm_typelist = TYPE_ARG_TYPES (TREE_TYPE (fn)), clone_parm = DECL_ARGUMENTS (clone); fn_parm; ++parmno, @@ -244,7 +248,7 @@ } else if (parmno == 1 && DECL_HAS_IN_CHARGE_PARM_P (fn)) { - tree in_charge = in_charge_arg_for_name (DECL_NAME (clone)); + tree in_charge = copy_node (in_charge_arg_for_name (DECL_NAME (clone))); parmlist = tree_cons (NULL, in_charge, parmlist); } /* Map other parameters to their equivalents in the cloned @@ -252,11 +256,17 @@ else { my_friendly_assert (clone_parm, 0); + DECL_ABSTRACT_ORIGIN (clone_parm) = NULL; parmlist = tree_cons (NULL, clone_parm, parmlist); - if (parmno == vtt_parmno && DECL_HAS_VTT_PARM_P (clone)) - DECL_ABSTRACT_ORIGIN (clone_parm) = fn_parm; clone_parm = TREE_CHAIN (clone_parm); } + /* Guarantee type compatibility by clobbering type of clone parameter + with type from fns' typelist. */ + if (fn_parm_typelist) + { + TREE_TYPE (TREE_VALUE (parmlist)) = TREE_VALUE (fn_parm_typelist); + fn_parm_typelist = TREE_CHAIN (fn_parm_typelist); + } } /* We built this list backwards; fix now. */ @@ -268,7 +278,7 @@ /* Now, expand this function into RTL, if appropriate. */ finish_function (0); - /* BLOCK_ABSTRACT_ORIGIN (DECL_INITIAL (clone)) = DECL_INITIAL (fn); ?? */ + DECL_ABSTRACT_ORIGIN (clone) = NULL; expand_body (clone); pop_from_top_level (); } No revision No revision 1.21.4.2 +1 -1 src/live/gcc3/gcc/objc/lang-specs.h Index: lang-specs.h =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/objc/lang-specs.h,v retrieving revision 1.21.4.1 retrieving revision 1.21.4.2 diff -u -r1.21.4.1 -r1.21.4.2 --- lang-specs.h 2002/10/01 21:22:20 1.21.4.1 +++ lang-specs.h 2002/12/11 20:47:58 1.21.4.2 @@ -37,7 +37,7 @@ %(cpp_precomp) -lang-objc -D__OBJC__ %{ansi:-std=c89} %(cpp_precomp_options) %y0}}}\ %{!E:%{!M:%{!MM:\ %{save-temps|no-integrated-cpp:\ - %{no-cpp-precomp|traditional-cpp|fload=*|fdump=*:\ + %{no-cpp-precomp|traditional-cpp|fload=*|fdump=*: \ %(trad_capable_cpp) -lang-objc -D__OBJC__ %{ansi:-std=c89} %(cpp_options) %{save-temps:%b.mi} %{!save-temps:%g.mi} \n\ cc1obj -fpreprocessed %{save-temps:%b.mi} %{!save-temps:%g.mi} %(cc1_options) %{gen-decls}}\ %{cpp-precomp|!no-cpp-precomp:%{!traditional-cpp:%{!fdump=*:%{!fload=*:%{!precomp:\ 1.96.2.5 +13 -2 src/live/gcc3/gcc/objc/objc-act.c Index: objc-act.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/objc/objc-act.c,v retrieving revision 1.96.2.4 retrieving revision 1.96.2.5 diff -u -r1.96.2.4 -r1.96.2.5 --- objc-act.c 2002/10/22 23:03:59 1.96.2.4 +++ objc-act.c 2002/12/11 20:47:58 1.96.2.5 @@ -4897,6 +4897,11 @@ chain; chain = TREE_CHAIN (chain)) { + if (TYPED_OBJECT (TREE_VALUE (chain)) + && !(TREE_VALUE (type) + && TREE_CODE (TREE_VALUE (type)) == INDIRECT_REF)) + error ("can not use an object as parameter to a method\n"); + if (!is_objc_type_qualifier (TREE_VALUE (chain))) return type; } @@ -5344,7 +5349,7 @@ if (iface) method_prototype = lookup_instance_method_static (iface, sel_name); - if (! method_prototype && TYPE_PROTOCOL_LIST (ctype)) + if (! method_prototype && ctype && TYPE_PROTOCOL_LIST (ctype)) method_prototype = lookup_method_in_protocol_list (TYPE_PROTOCOL_LIST (ctype), sel_name, 0); @@ -7997,9 +8002,15 @@ { super_class = get_class_reference (super_name); if (TREE_CODE (objc_method_context) == CLASS_METHOD_DECL) + /* APPLE LOCAL begin call super */ + /* Cast the super class to 'id', since the user may not have + included <objc/objc-class.h>, leaving 'struct objc_class' + an incomplete type. */ super_class - = build_component_ref (build_indirect_ref (super_class, "->"), + = build_component_ref (build_indirect_ref + (build_c_cast (id_type, super_class), "->"), get_identifier ("isa")); + /* APPLE LOCAL end super call */ } else { No revision No revision 1.9.2.3 +3 -0 src/live/gcc3/gcc/pfe/cp-freeze-thaw.c Index: cp-freeze-thaw.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/pfe/cp-freeze-thaw.c,v retrieving revision 1.9.2.2 retrieving revision 1.9.2.3 diff -u -r1.9.2.2 -r1.9.2.3 --- cp-freeze-thaw.c 2002/07/13 02:51:45 1.9.2.2 +++ cp-freeze-thaw.c 2002/12/11 20:47:59 1.9.2.3 @@ -452,6 +452,9 @@ PFE_FREEZE_THAW_WALK (p->class_type); PFE_FREEZE_THAW_WALK (p->access_specifier); PFE_FREEZE_THAW_WALK (p->function_decl); + if (PFE_FREEZING) + while (VARRAY_ACTIVE_SIZE (p->lang_base) > 0) + pop_lang_context (); pfe_freeze_thaw_varray_tree (&p->lang_base); PFE_FREEZE_THAW_WALK (p->lang_name); PFE_FREEZE_THAW_WALK (p->template_parms); 1.22.2.1 +2 -2 src/live/gcc3/gcc/pfe/pfe-header.c Index: pfe-header.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/pfe/pfe-header.c,v retrieving revision 1.22 retrieving revision 1.22.2.1 diff -u -r1.22 -r1.22.2.1 --- pfe-header.c 2002/06/20 18:41:32 1.22 +++ pfe-header.c 2002/12/11 20:47:59 1.22.2.1 @@ -143,7 +143,7 @@ it is not a match. */ if (header->inode != inode) { - error ("Precompiled header is invalid; header file %s is now different.", full_name); + fatal_error ("Precompiled header is invalid; header file %s is now different.", full_name); pfe_free (full_name); return 0; } @@ -153,7 +153,7 @@ PFE file. */ if (timestamp > header->timestamp) { - error ("Precompiled header is out of date; header file %s is newer.", full_name); + fatal_error ("Precompiled header is out of date; header file %s is newer.", full_name); pfe_free (full_name); return 0; } 1.4.2.2 +28 -22 src/live/gcc3/gcc/pfe/pfe-mem.c Index: pfe-mem.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/pfe/pfe-mem.c,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -r1.4.2.1 -r1.4.2.2 --- pfe-mem.c 2002/10/23 01:14:09 1.4.2.1 +++ pfe-mem.c 2002/12/11 20:47:59 1.4.2.2 @@ -62,6 +62,8 @@ inefficient in causing many more blocks and fragments to be searched when trying to do an allocation, especially when we don't find a suitable fragment and are forced to allocate a new block. +* We may want to deal someday with fragmentable blocks of arbitrary + size. TO DO: * Check for best (or better) fit for fragment, rather than just first. @@ -113,8 +115,12 @@ #define MINIMIZE_RANGES 1 /* Flag indicating whether this is an implementation specific for - Macintosh OS X. */ + Macintosh OS X. Should be autoconfiscated someday. */ +#ifdef CONFIG_DARWIN_H #define APPLE_OS_X_IMPLEMENTATION 1 +#else +#define APPLE_OS_X_IMPLEMENTATION 0 +#endif #include "config.h" #include "system.h" @@ -312,8 +318,8 @@ /* Initialize the memory range table. */ pfem_range_table_size = PFEM_INITIAL_RANGE_TABLE_SIZE; pfem_range_table = (pfem_range *) - pfem_malloc (sizeof (pfem_range) - * pfem_range_table_size); + xmalloc (sizeof (pfem_range) + * pfem_range_table_size); /* Enter the initial block of memory in the range table. */ pfem_add_block_to_range_table (initial_block, PFEM_FRAG_BLOCK_SIZE); @@ -516,9 +522,9 @@ { pfem_range_table_size += PFEM_RANGE_TABLE_INCR; pfem_range_table = (pfem_range *) - pfem_realloc (pfem_range_table, - sizeof (pfem_range) - * pfem_range_table_size); + xrealloc (pfem_range_table, + sizeof (pfem_range) + * pfem_range_table_size); } /* Entries in the range table need to be sorted by address. Perform @@ -691,14 +697,11 @@ return data; } -/* Set up the first fragment in a fragmentable block. The - "first_block" parameter indicates whether this is the first - fragmentable block being set up by pfem_init. That first block - requires special treatment: its block_info record has not yet - been set up because the block info list does not yet exist. */ -// ??? We may want to allow this to deal with arbitrary size fragmentable blocks. +/* Set up the first fragment in a fragmentable block. The first + fragment is the pfem_block_info entry for the block itself. */ -pfem_block_info *pfem_set_up_frag_block (block_addr, size) +pfem_block_info * +pfem_set_up_frag_block (block_addr, size) void *block_addr; size_t size; { @@ -750,10 +753,10 @@ printf ("pfem_alloc_whole_block: request size = %d\n", size); #endif - /* Adjust the size (if necessary) to take into account alignment - considerations. */ + /* Adjust the size (if necessary) so as not to create blocks with + weird sizes. Right now this rounds to multiples of 1K. */ bytes_needed = (size + 1023) & 0xFFFFFC00; - // ??? What allocation alignment do we want? + #if PFEM_DEBUG printf (" pfem_alloc_whole_block: bytes_needed = %d\n", bytes_needed); #endif @@ -784,7 +787,8 @@ { /* ??? If we find a block that is big enough to split and satisfy the request with the remainder still being - large enough to be a whole block, consider doing that. */ + large enough to be a whole block, consider splitting the + block and keeping the remainder in play. */ if ((best_block_info == NULL) || (block_info->size < best_block_info->size)) best_block_info = block_info; @@ -899,7 +903,7 @@ can't satisfy a fragment allocation request, and, in order to allocate the new block we also have to allocate a new fragment for the new block's block info entry. - This lead to the decision to allocate the fragment + This issue led to the decision to allocate the fragment for the block info entry as the first fragment in the new fragmentable block. */ block_addr = pfem_alloc_block (PFEM_FRAG_BLOCK_SIZE); @@ -921,7 +925,7 @@ #endif #if PFEM_DEBUG printf (" pfem_alloc_fragment: allocating a new block at 0x%x\n", - block_addr); + block_addr); #endif } #if PFEM_DEBUG @@ -1012,16 +1016,18 @@ last_fragment = fragment; fragment = fragment->next; } +#if 0 /* We should not get here. If we do, we did not find a fragment that was big enough, even though the largest_free_fragment_size field in the block info indicated we should. */ -#if 0 - // ??? The largest_free_fragment_size field is not yet being properly maintained. printf (" ***pfem_alloc_fragment: did not find fragment. " "largest_free_fragment_size incorrect\n"); +#else + /* ??? The largest_free_fragment_size field is not yet being + properly maintained. For now we continue on and try the + next block. */ #endif - // ??? for now we will continue on and try the next block } block_info = block_info->next_avail; #if USE_BLOCK_ROVER 1.15.2.2 +35 -110 src/live/gcc3/gcc/pfe/pfe.c Index: pfe.c =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/pfe/pfe.c,v retrieving revision 1.15.2.1 retrieving revision 1.15.2.2 diff -u -r1.15.2.1 -r1.15.2.2 --- pfe.c 2002/10/14 23:07:51 1.15.2.1 +++ pfe.c 2002/12/11 20:48:00 1.15.2.2 @@ -21,12 +21,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Flag whether we are using the Macintosh OS X scalable_malloc - implementation for the PFE's memory management functions. */ -#ifndef USE_APPLE_SCALABLE_MALLOC -#define USE_APPLE_SCALABLE_MALLOC 0 -#endif - /* The GENERATOR_FILE is used to suppress some includes in config.h such as insn-flags.h and insn-flags.h which we don't want nor need for the files that use pfe-header.h. Unfortunately this @@ -45,18 +39,6 @@ #undef GENERATOR_FILE -/* The scalable_malloc.h header must be included BEFORE any gcc headers. - This is necessary because system.h "poisons" the use of malloc, calloc, - and realloc when building the compiler itself with a 3.x version or - greater. The scalable_malloc.h references malloc so it cannot be - poisoned. And since the header is really independent of the gcc - anyway it doesn't need any of its headers so we have no problem - including it first. */ - -#if USE_APPLE_SCALABLE_MALLOC -#include "scalable_malloc.h" -#endif - #include "config.h" #include "system.h" #include "timevar.h" @@ -69,10 +51,7 @@ #include <sys/stat.h> #include <sys/time.h> -#if !USE_APPLE_SCALABLE_MALLOC #include "pfe-mem.h" -#endif - #include "pfe.h" #include "pfe-header.h" @@ -152,11 +131,8 @@ /* Size of file loaded in load operation. */ static unsigned int pfe_load_buffer_size = 0; -#if USE_APPLE_SCALABLE_MALLOC -/* Memory "zone" in which the compiler structures the PFE will "dump" - are allocated. */ -static malloc_zone_t *pfe_memory_zone = 0; -#endif +/* Flags indicating how the PFE load buffer was allocated. */ +static int pfe_load_buffer_was_malloced = 0; /* Table with entries for each memory range to be "dump"ed. */ static pfe_dump_memory_range *pfe_dump_range_table; @@ -277,9 +253,9 @@ #endif /* PFE_MALLOC_STATS */ /* Switch to turn On/Off macro validation. - Command line option --validate-pch enables macro validation, - if it is disabled by default. */ -int pfe_macro_validation = 0; + Command line option -fno-validate disables macro validation, + if it is now enabled by default. */ +int pfe_macro_validation = 1; int pfe_cmd_ln_macro_count = 0; int pfe_macro_status = PFE_MACRO_NOT_FOUND; /* Prototypes for static functions. */ @@ -347,11 +323,7 @@ { enum pfe_action saved_pfe_operation; -#if USE_APPLE_SCALABLE_MALLOC - pfe_memory_zone = create_scalable_zone (0, 0); -#else pfem_init (); -#endif pfe_dump_range_table_size = PFE_INITIAL_DUMP_RANGE_TABLE_SIZE; pfe_dump_range_table = (pfe_dump_memory_range *) xmalloc (sizeof (pfe_dump_memory_range) @@ -409,11 +381,6 @@ else if (pfe_operation == PFE_LOAD) { /* Nothing special required for loading at this time. */ -#if USE_APPLE_SCALABLE_MALLOC - pfe_memory_zone = 0; -#else - /* FIXME: Provide portable implementation for FSF someday. */ -#endif pfe_freeze_thaw_ptr_fp = pfe_thaw_ptr; } else if (pfe_operation == PFE_NOP) @@ -493,31 +460,18 @@ - pfe_dump_range_table[range_idx].start_addr + 512) / 1024)); #endif -#if USE_APPLE_SCALABLE_MALLOC - /* We don't need to make the following call to destroy the - pfe_memory_zone since this will be taken care of by the usual - process termination clean up. Besides, the scalable_malloc - implementation of this call currently has a bug. */ - //pfe_memory_zone->destroy (pfe_memory_zone); - pfe_memory_zone = 0; -#else - /* FIXME: Provide portable implementation for FSF someday. */ pfem_term (); -#endif free (pfe_compiler_state_ptr); } else if (pfe_operation == PFE_LOAD) { -#if PFE_NO_THAW_LOAD - if ((unsigned)pfe_load_buffer_ptr == PFE_NO_THAW_LOAD_ADDR) + if (pfe_load_buffer_was_malloced) + free (pfe_load_buffer_ptr); + else { - /* FIXME: Do we need to do anything to deallocate this memory? */ + /* FIXME: The load buffer was allocated via mmap or vm_allocate. + Do we need to do anything to deallocate this memory? */ } - else - free (pfe_load_buffer_ptr); -#else - free (pfe_load_buffer_ptr); -#endif pfe_load_buffer_ptr = 0; } else @@ -598,9 +552,9 @@ pfe_file = fopen (pathname, fdump ? "w" : "r"); if (pfe_file == NULL) fatal_error ("Cannot open %s file: %s (%s)", - fdump ? "dump" : "load", - pathname, xstrerror (errno)); - + fdump ? "dump" : "load", + pathname, xstrerror (errno)); + free (pfe_basename); pfe_name = pathname; @@ -642,11 +596,14 @@ rmdir (pfe_dirname); else { +#ifdef CONFIG_DARWIN_H + /* This is Darwin-specific. */ TIMESPEC_TO_TIMEVAL (&tval[0], &pfe_file_stat.st_atimespec); TIMESPEC_TO_TIMEVAL (&tval[1], &pfe_file_stat.st_mtimespec); if (utimes (pfe_dirname, tval) != 0) fatal_error ("Cannot reset mod time for pre-compiled header directory: \"%s\" (%s)", pfe_dirname, xstrerror (errno)); +#endif } } else if (utimes (pfe_dirname, NULL) != 0) @@ -743,12 +700,7 @@ assign them offsets in the dump file, and create a table with <location, size, file offset> information for each chunk. */ -#if USE_APPLE_SCALABLE_MALLOC - scalable_zone_find_ranges (pfe_memory_zone, pfe_add_dump_range); -#else - /* FIXME: Provide portable implementation for FSF someday. */ pfem_id_ranges (pfe_add_dump_range); -#endif pfe_assign_dump_range_offsets (the_header_size); #if PFE_NO_THAW_LOAD @@ -862,24 +814,29 @@ taddr = mmap (taddr, pfe_load_buffer_size, PROT_READ | PROT_WRITE, - MAP_FILE | MAP_FIXED | MAP_PRIVATE, + MAP_FILE | MAP_PRIVATE, fileno (the_file), (off_t)0); - if (taddr == (caddr_t)PFE_NO_THAW_LOAD_ADDR) + if (taddr != MAP_FAILED) { #if PFE_NO_THAW_LOAD_DIAGNOSTICS - printf ("pfe_load: mmap succeeded.\n"); + if (taddr == (caddr_t)PFE_NO_THAW_LOAD_ADDR) + printf ("pfe_load: mmap at 0x%X (requested address)\n", + (unsigned long)PFE_NO_THAW_LOAD_ADDR); + else + printf ("pfe_load: mmap at 0x%X (not requested address)\n", + (unsigned long)taddr); #endif - pfe_load_buffer_ptr = (char *)PFE_NO_THAW_LOAD_ADDR; + pfe_load_buffer_ptr = (char *)taddr; } else { #if PFE_NO_THAW_LOAD_DIAGNOSTICS - printf ("pfe_load: mmap failed (returned &d; errno = %d); " - "retrying using malloc.\n", - (int)taddr, errno); + printf ("pfe_load: mmap failed (errno = %d); retrying using " + "malloc.\n", errno); #endif pfe_load_buffer_ptr = (char *) xmalloc (pfe_load_buffer_size); + pfe_load_buffer_was_malloced = 1; } #else int return_code; @@ -898,27 +855,28 @@ printf ("pfe_load: vm_allocate failed; retrying using malloc.\n"); #endif pfe_load_buffer_ptr = (char *) xmalloc (pfe_load_buffer_size); + pfe_load_buffer_was_malloced = 1; } #endif } #else pfe_load_buffer_ptr = (char *) xmalloc (pfe_load_buffer_size); + pfe_load_buffer_was_malloced = 1; #endif if (pfe_load_buffer_ptr == 0) fatal_error ("PFE: unable to allocate memory (%d bytes) for load file", pfe_load_buffer_size); + #if PFE_NO_THAW_LOAD #if PFE_NO_THAW_LOAD_USING_MMAP -#else - if ((fread (pfe_load_buffer_ptr, 1, pfe_load_buffer_size, the_file) - != pfe_load_buffer_size)) - fatal_io_error ("PFE: unable to read load file"); + /* The load file does not have to be read in if it was mapped in + using mmap. */ + if (! pfe_load_buffer_was_malloced) #endif -#else +#endif if ((fread (pfe_load_buffer_ptr, 1, pfe_load_buffer_size, the_file) != pfe_load_buffer_size)) fatal_io_error ("PFE: unable to read load file"); -#endif return pfe_load_buffer_ptr; } @@ -994,11 +952,7 @@ { if (pfe_operation == PFE_DUMP) { -#if USE_APPLE_SCALABLE_MALLOC - return scalable_zone_ptr_is_in_zone (pfe_memory_zone, ptr); -#else return pfem_is_pfe_mem (ptr); -#endif } else if (pfe_operation == PFE_LOAD) { @@ -1335,17 +1289,7 @@ pfe_internal_error ("pfe_malloc: allocation routine called " "when freezing"); #endif -#if USE_APPLE_SCALABLE_MALLOC - /* really_call_malloc is actual a macro to generate malloc to - get around the "poisoning" of malloc in system.h. */ - p = pfe_memory_zone->really_call_malloc (pfe_memory_zone, size); -#if 0 - printf ("pfe_malloc: 0x%08X size %d\n", p, size); -#endif -#else - /* FIXME: Provide portable implementation for FSF someday. */ p = pfem_malloc (size); -#endif if (!p) fatal_error ("PFE: memory exhausted"); } @@ -1378,14 +1322,7 @@ pfe_internal_error ("pfe_calloc: allocation routine called " "when freezing"); #endif -#if USE_APPLE_SCALABLE_MALLOC - /* really_call_calloc is actual a macro to generate calloc to - get around the "poisoning" of calloc in system.h. */ - p = pfe_memory_zone->really_call_calloc (pfe_memory_zone, nobj, size); -#else - /* FIXME: Provide portable implementation for FSF someday. */ p = pfem_calloc (nobj, size); -#endif if (!p) fatal_error ("PFE: memory exhausted"); } @@ -1415,14 +1352,7 @@ pfe_internal_error ("pfe_realloc: allocation routine called " "when freezing"); #endif -#if USE_APPLE_SCALABLE_MALLOC - /* really_call_realloc is actual a macro to generate calloc to - get around the "poisoning" of realloc in system.h. */ - p = pfe_memory_zone->really_call_realloc (pfe_memory_zone, p, size); -#else - /* FIXME: Provide portable implementation for FSF someday. */ p = pfem_realloc (p, size); -#endif if (!p) fatal_error ("PFE: memory exhausted"); } @@ -1473,12 +1403,7 @@ if (pfe_operation == PFE_DUMP) { -#if USE_APPLE_SCALABLE_MALLOC - pfe_memory_zone->free (pfe_memory_zone, ptr); -#else - /* FIXME: Provide portable implementation for FSF someday. */ pfem_free (ptr); -#endif } else if (pfe_operation == PFE_LOAD) { No revision No revision 1.1.12.1 +0 -0 src/live/gcc3/gcc/testsuite/g++.dg/preserve-PPC-CR.C Index: preserve-PPC-CR.C =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/testsuite/g++.dg/preserve-PPC-CR.C,v retrieving revision 1.1 retrieving revision 1.1.12.1 diff -u -r1.1 -r1.1.12.1 No revision No revision 1.2.2.1 +0 -0 src/live/gcc3/gcc/testsuite/objc++.dg/Attic/super-class-1.mm No revision No revision 1.2.4.1 +4 -19 src/live/gcc3/gcc/testsuite/objc.dg/super-class-2.m Index: super-class-2.m =================================================================== RCS file: /cvs/Darwin/src/live/gcc3/gcc/testsuite/objc.dg/super-class-2.m,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -u -r1.2 -r1.2.4.1 --- super-class-2.m 2002/10/24 23:50:01 1.2 +++ super-class-2.m 2002/12/11 20:48:02 1.2.4.1 @@ -1,29 +1,13 @@ -/* Test calling super from within a category class method. */ -/* Author: Ziemowit Laski <[EMAIL PROTECTED]> */ +/* APPLE LOCAL file call super */ +/* Test calling super from within a category method. */ /* { dg-do compile } */ -/* { dg-options "-fnext-runtime" } */ +#import <objc/objc.h> -typedef struct objc_object { struct objc_class *isa; } *id; - @interface NSObject -+ (int) test_func0; @end @interface NSMenuItem: NSObject -+ (int) test_func0; @end -@implementation NSObject -+ (int) test_func0 -{} -@end - -@implementation NSMenuItem -+ (int) test_func0 -{ - return [super test_func0]; -} -@end - @interface NSObject (Test) + (int) test_func; @end @@ -43,3 +27,4 @@ return [super test_func]; /* { dg-bogus "dereferencing pointer to incomplete type" } */ } @end +