This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fixes for Darwin/x86


We've been neglecting the Darwin/x86 port. Mea culpa.

My Darwin/x86 box is currently running version 8F1111 of OS X, upgraded with cctools v590.20 (cctools means assembler, static and dynamic linkers, etc).

The current Darwin/x86 mainline GCC currently fails about 750 DejaGnu testcases for C. That's using the 590.20 linker; older linkers generate a warning that breaks an additional 70-odd tests.

The attached patch reduces this to 80 failures for C. ObjC gains about 160 passes, no regressions, and ObjC++ show no regressions.

C++ shows no regressions, but about 30 currently PASSing tests become UNSUPPORTED; I think this is a DejaGnu issue. The patch adds a Darwin/ x86-only warning that says "-fpic is not supported; -fPIC assumed", just like Darwin/PPC, and the warning frightens DejaGnu into avoiding g++.dg/debug/debug3.C (see the -fpic checking in testsuite/lib/target- supports.exp). DejaGnu has a regular expression that should match and ignore the warning (testsuite/lib/prune.exp); obviously it's not working. Somebody (probably me) should figure this out. For now, the attached patch duplicates the Darwin/PPC UNSUPPORTED behavior; Darwin/PPC and Darwin/x86 become "bug-for-bug compatible." ;-)

AFAICT, Darwin/x86 must be the only GCC port where the default stack alignment can be /lowered/ from the commandline ("-mpreferred-stack- boundary=2"). Darwin requires a 16-byte (SSE) stack alignment, yet the Darwin/x86 GCC is obliged to support a few projects (cough*kernel*cough) that require 4-byte alignment. It's trivial to make the STACK_BOUNDARY macro expand to a variable, but that won't bootstrap, as the middle-end uses STACK_BOUNDARY in signed and unsigned comparisons. This hasn't been a problem before, as every other port seems to define STACK_BOUNDARY to an integral constant (or a ?: yielding multiple integer constants) of indeterminate signedness. Since we must pick one signedness, I arbitrarily chose to make stack alignments "unsigned" in the attached patch; if the reviewers prefer otherwise, I'll change it. IMHO, the consistency is important; the choice is not.

I've revised the x86 Mach-O "picbase" stuff to support multiple instances of "builtin_setjmp_receiver," including a new "darwin.md" file, all slavishly copied from GeoffKs PPC implementation. This fixes many DejaGnu EH failures.

The patch adds Mach-O support for TARGET_DEEP_BRANCH_PREDICTION, since it was tied in with all the picbase wrangling. Not a big deal.

On Darwin/x86: Bootstrapped, DejaGnu, about 30 "UNSUPPORTED" regressions in DejaGnu/C++ (described above).
On Darwin/PPC: Bootstrapped.
On Linux/x86: Bootstrapped.


2005-11-30 Stuart Hastings <stuart@apple.com>

        * gcc/function.c (pad_to_arg_alignment): Stack alignments are
        unsigned.
        * gcc/calls.c (compute_argument_block_size): Ditto.
        * gcc/cfgexpand.c (expand_one_stack_var_at): Ditto.
        * gcc/config/i386/darwin.md: New file.
        * gcc/config/i386/i386.md (darwin.md): Include it.
        (UNSPEC_LD_MPIC): New.  (builtin_setjmp_receiver):
        Re-materialize Mach-O picbase.
        * gcc/config/i386/darwin.h (SUBTARGET_OVERRIDE_OPTIONS):
        Equate -fpic to -fPIC. (STACK_BOUNDARY): Darwin 16-byte stack
        alignment.  (TARGET_ASM_FILE_END):  New.
	(TARGET_DEEP_BRANCH_PREDICTION): Remove.
        (GOT_SYMBOL_NAME): Mach-O support.
        * gcc/config/i386/i386.c (override_options): Simplify stack
        boundary computation. (get_pc_thunk_name): Mach-O picbase
	re-materialization support.  (darwin_x86_file_end): New.

Patch:

Attachment: gcc.fsf.bugs.diffs.txt
Description: Text document


New file (config/i386/darwin.md):

Attachment: darwin.md
Description: Binary data


O.K. to commit to mainline?


stuart hastings
Apple Computer



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]