diff options
Diffstat (limited to 'contrib/gcc/config')
-rw-r--r-- | contrib/gcc/config/alpha/alpha.c | 23 | ||||
-rw-r--r-- | contrib/gcc/config/alpha/elf.h | 4 | ||||
-rw-r--r-- | contrib/gcc/config/alpha/freebsd.h | 41 | ||||
-rw-r--r-- | contrib/gcc/config/freebsd-spec.h | 86 | ||||
-rw-r--r-- | contrib/gcc/config/freebsd.h | 19 | ||||
-rw-r--r-- | contrib/gcc/config/i386/freebsd.h | 290 | ||||
-rw-r--r-- | contrib/gcc/config/i386/freebsd64.h | 13 | ||||
-rw-r--r-- | contrib/gcc/config/i386/i386.c | 8 | ||||
-rw-r--r-- | contrib/gcc/config/i386/i386.h | 17 | ||||
-rw-r--r-- | contrib/gcc/config/i386/i386.md | 16 | ||||
-rw-r--r-- | contrib/gcc/config/i386/x86-64.h | 10 | ||||
-rw-r--r-- | contrib/gcc/config/rs6000/freebsd.h | 6 | ||||
-rw-r--r-- | contrib/gcc/config/sparc/freebsd.h | 11 | ||||
-rw-r--r-- | contrib/gcc/config/x-linux | 4 |
14 files changed, 374 insertions, 174 deletions
diff --git a/contrib/gcc/config/alpha/alpha.c b/contrib/gcc/config/alpha/alpha.c index f9aef99..fbaeabe 100644 --- a/contrib/gcc/config/alpha/alpha.c +++ b/contrib/gcc/config/alpha/alpha.c @@ -5469,21 +5469,6 @@ print_operand (FILE *file, rtx x, int code) } break; - case 'j': - { - const char *lituse; - -#ifdef HAVE_AS_JSRDIRECT_RELOCS - lituse = "lituse_jsrdirect"; -#else - lituse = "lituse_jsr"; -#endif - - if (INTVAL (x) == 0) - abort (); - fprintf (file, "\t\t!%s!%d", lituse, (int) INTVAL (x)); - } - break; case 'r': /* If this operand is the constant zero, write it as "$31". */ if (GET_CODE (x) == REG) @@ -8829,7 +8814,7 @@ alpha_align_insns (unsigned int max_align, unsigned int align; /* OFS is the offset of the current insn in the insn group. */ int ofs; - int prev_in_use, in_use, len, ldgp; + int prev_in_use, in_use, len; rtx i, next; /* Let shorten branches care for assigning alignments to code labels. */ @@ -8847,8 +8832,6 @@ alpha_align_insns (unsigned int max_align, if (GET_CODE (i) == NOTE) i = next_nonnote_insn (i); - ldgp = alpha_function_needs_gp ? 8 : 0; - while (i) { next = (*next_group) (i, &in_use, &len); @@ -8905,10 +8888,6 @@ alpha_align_insns (unsigned int max_align, } } - /* We may not insert padding inside the initial ldgp sequence. */ - else if (ldgp > 0) - ldgp -= len; - /* If the group won't fit in the same INT16 as the previous, we need to add padding to keep the group together. Rather than simply leaving the insn filling to the assembler, we diff --git a/contrib/gcc/config/alpha/elf.h b/contrib/gcc/config/alpha/elf.h index 34bba3e..97b15fe 100644 --- a/contrib/gcc/config/alpha/elf.h +++ b/contrib/gcc/config/alpha/elf.h @@ -20,9 +20,11 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* $FreeBSD$ */ + #undef OBJECT_FORMAT_COFF #undef EXTENDED_COFF -#define OBJECT_FORMAT_ELF +#define OBJECT_FORMAT_ELF 1 /* ??? Move all SDB stuff from alpha.h to osf.h. */ #undef SDB_DEBUGGING_INFO diff --git a/contrib/gcc/config/alpha/freebsd.h b/contrib/gcc/config/alpha/freebsd.h index 0b29361..b007989 100644 --- a/contrib/gcc/config/alpha/freebsd.h +++ b/contrib/gcc/config/alpha/freebsd.h @@ -19,6 +19,7 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* $FreeBSD$ */ #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ @@ -33,6 +34,7 @@ Boston, MA 02111-1307, USA. */ #define FBSD_TARGET_CPU_CPP_BUILTINS() \ do \ { \ + builtin_define ("__LP64__"); \ if (flag_pic) \ { \ builtin_define ("__PIC__"); \ @@ -56,6 +58,12 @@ Boston, MA 02111-1307, USA. */ %{static:-Bstatic}} \ %{symbolic:-Bsymbolic}" +/* Reset our STARTFILE_SPEC because of a moronic pigheaded + Linuxism(glibc'ism) that was added to alpha/elf.h. */ + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC FBSD_STARTFILE_SPEC + /************************[ Target stuff ]***********************************/ @@ -69,10 +77,28 @@ Boston, MA 02111-1307, USA. */ #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE 32 +/* Handle cross-compilation on 32-bits machines (such as i386) for 64-bits + machines (Alpha in this case). */ + +#if defined(__i386__) +#undef HOST_BITS_PER_LONG +#define HOST_BITS_PER_LONG 32 +#undef HOST_WIDE_INT +#define HOST_WIDE_INT long long +#undef HOST_BITS_PER_WIDE_INT +#define HOST_BITS_PER_WIDE_INT 64 +#endif + +/* This is the pseudo-op used to generate a 64-bit word of data with a + specific value in some section. */ + #undef TARGET_VERSION -#define TARGET_VERSION fprintf (stderr, " (FreeBSD/alpha ELF)"); +#define TARGET_VERSION fprintf (stderr, " (FreeBSD/Alpha ELF)"); + +#define TARGET_ELF 1 -#define TARGET_ELF 1 +#undef OBJECT_FORMAT_COFF +#undef EXTENDED_COFF #undef TARGET_DEFAULT #define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS) @@ -83,6 +109,17 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_PROFILING_NEEDS_GP #define TARGET_PROFILING_NEEDS_GP 1 +/* We always use gas here, so we don't worry about ECOFF assembler problems. */ +#undef TARGET_GAS +#define TARGET_GAS 1 + + +/************************[ Assembler stuff ]********************************/ + + + +/************************[ Debugger stuff ]*********************************/ + /* This is the char to use for continuation (in case we need to turn continuation back on). */ diff --git a/contrib/gcc/config/freebsd-spec.h b/contrib/gcc/config/freebsd-spec.h index 8acf0ca..a070936 100644 --- a/contrib/gcc/config/freebsd-spec.h +++ b/contrib/gcc/config/freebsd-spec.h @@ -18,6 +18,8 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* $FreeBSD$ */ + /* Common FreeBSD configuration. All FreeBSD architectures should include this file, which will specify their commonalities. @@ -51,27 +53,13 @@ Boston, MA 02111-1307, USA. */ #define FBSD_TARGET_OS_CPP_BUILTINS() \ do \ { \ - if (FBSD_MAJOR == 9) \ - builtin_define ("__FreeBSD__=9"); \ - else if (FBSD_MAJOR == 8) \ - builtin_define ("__FreeBSD__=8"); \ - if (FBSD_MAJOR == 7) \ - builtin_define ("__FreeBSD__=7"); \ - else if (FBSD_MAJOR == 6) \ - builtin_define ("__FreeBSD__=6"); \ - else if (FBSD_MAJOR == 5) \ - builtin_define ("__FreeBSD__=5"); \ - else if (FBSD_MAJOR == 4) \ - builtin_define ("__FreeBSD__=4"); \ - else if (FBSD_MAJOR == 3) \ - builtin_define ("__FreeBSD__=3"); \ - else \ - builtin_define ("__FreeBSD__"); \ + builtin_define_with_int_value ("__FreeBSD__", FBSD_MAJOR); \ builtin_define_std ("unix"); \ builtin_define ("__KPRINTF_ATTRIBUTE__"); \ builtin_assert ("system=unix"); \ builtin_assert ("system=bsd"); \ builtin_assert ("system=FreeBSD"); \ + FBSD_NATIVE_TARGET_OS_CPP_BUILTINS(); \ FBSD_TARGET_CPU_CPP_BUILTINS(); \ } \ while (0) @@ -79,34 +67,55 @@ Boston, MA 02111-1307, USA. */ /* Define the default FreeBSD-specific per-CPU hook code. */ #define FBSD_TARGET_CPU_CPP_BUILTINS() do {} while (0) +#ifdef FREEBSD_NATIVE +#define FBSD_NATIVE_TARGET_OS_CPP_BUILTINS() \ + do { \ + builtin_define_with_int_value ("__FreeBSD_cc_version", FBSD_CC_VER); \ + } while (0) +#else +#define FBSD_NATIVE_TARGET_OS_CPP_BUILTINS() \ + do {} while (0) +#endif + /* Provide a CPP_SPEC appropriate for FreeBSD. We just deal with the GCC - option `-posix', and PIC issues. */ + option `-posix', and PIC issues. Try to detect support for the + `long long' type. Unfortunately the GCC spec parser will not allow us + to properly detect the "iso9899:1990" and "iso9899:199409" forms of + -std=c89. Because of the ':' in the -std argument. :-( I have left + them in the spec as a place holder in hopes someone knows a way to make + the detection of them work. */ #define FBSD_CPP_SPEC " \ %(cpp_cpu) \ %{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} \ + %{!ansi:%{!std=c89:%{!std=iso9899.1990:%{!std=iso9899.199409:-D_LONGLONG}}}} \ %{posix:-D_POSIX_SOURCE}" -/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add - the magical crtbegin.o file (see crtstuff.c) which provides part - of the support for getting C++ file-scope static object constructed - before entering `main'. */ +/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add the magical + crtbegin.o file (see crtstuff.c) which provides part of the support for + getting C++ file-scope static object constructed before entering `main'. */ -#define FBSD_STARTFILE_SPEC \ - "%{!shared: \ - %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ - %{!p:%{profile:gcrt1.o%s} \ - %{!profile:crt1.o%s}}}} \ - crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" - -/* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on - the magical crtend.o file (see crtstuff.c) which provides part of - the support for getting C++ file-scope static object constructed - before entering `main', followed by a normal "finalizer" file, - `crtn.o'. */ - -#define FBSD_ENDFILE_SPEC \ - "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" +#define FBSD_STARTFILE_SPEC "\ + %{!shared: \ + %{pg:gcrt1.o%s} \ + %{!pg: \ + %{p:gcrt1.o%s} \ + %{!p: \ + %{profile:gcrt1.o%s} \ + %{!profile:crt1.o%s}}}} \ + crti.o%s \ + %{!shared:crtbegin.o%s} \ + %{shared:crtbeginS.o%s}" + +/* Provide an ENDFILE_SPEC appropriate for FreeBSD/i386. Here we tack on + our own magical crtend.o file (see crtstuff.c) which provides part of + the support for getting C++ file-scope static object constructed before + entering `main', followed by the normal "finalizer" file, `crtn.o'. */ + +#define FBSD_ENDFILE_SPEC "\ + %{!shared:crtend.o%s} \ + %{shared:crtendS.o%s} \ + crtn.o%s " /* Provide a LIB_SPEC appropriate for FreeBSD as configured and as required by the user-land thread model. Before __FreeBSD_version @@ -135,7 +144,8 @@ is built with the --enable-threads configure-time option.} \ %{pg: -lc_p} \ }" #else -#if FBSD_MAJOR < 5 +#include <sys/param.h> +#if __FreeBSD_version < 500016 #define FBSD_LIB_SPEC " \ %{!shared: \ %{!pg: \ @@ -154,7 +164,7 @@ is built with the --enable-threads configure-time option.} \ #endif #endif -#if FBSD_MAJOR < 6 +#if FBSD_MAJOR < 5 #define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1" #else #define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1" diff --git a/contrib/gcc/config/freebsd.h b/contrib/gcc/config/freebsd.h index 542fd0b..9a9ec96 100644 --- a/contrib/gcc/config/freebsd.h +++ b/contrib/gcc/config/freebsd.h @@ -1,5 +1,5 @@ /* Base configuration file for all FreeBSD targets. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GCC. @@ -26,6 +26,7 @@ Boston, MA 02111-1307, USA. */ Further work by David O'Brien <obrien@FreeBSD.org> and Loren J. Rittle <ljrittle@acm.org>. */ +/* $FreeBSD$ */ /* In case we need to know. */ #define USING_CONFIG_FREEBSD 1 @@ -61,7 +62,7 @@ Boston, MA 02111-1307, USA. */ /* All FreeBSD Architectures support the ELF object file format. */ #undef OBJECT_FORMAT_ELF -#define OBJECT_FORMAT_ELF +#define OBJECT_FORMAT_ELF 1 /* Don't assume anything about the header files. */ #undef NO_IMPLICIT_EXTERN_C @@ -72,10 +73,18 @@ Boston, MA 02111-1307, USA. */ #undef WCHAR_TYPE #define WCHAR_TYPE "int" +#ifdef FREEBSD_NATIVE +#define LIBSTDCXX_PROFILE "-lstdc++_p" +#endif #define MATH_LIBRARY_PROFILE "-lm_p" /* Code generation parameters. */ +/* Writing `int' for a bitfield forces int alignment for the structure. */ +/* XXX: ok for Alpha?? */ +#undef PCC_BITFIELD_TYPE_MATTERS +#define PCC_BITFIELD_TYPE_MATTERS 1 + /* Use periods rather than dollar signs in special g++ assembler names. This ensures the configuration knows our system correctly so we can link with libraries compiled with the native cc. */ @@ -84,4 +93,8 @@ Boston, MA 02111-1307, USA. */ /* Used by libgcc2.c. We support file locking with fcntl / F_SETLKW. This enables the test coverage code to use file locking when exiting a program, which avoids race conditions if the program has forked. */ -#define TARGET_HAS_F_SETLKW +#define TARGET_HAS_F_SETLKW 1 + +/* Define this so we can compile MS code for use with WINE. */ +#define HANDLE_PRAGMA_PACK_PUSH_POP + diff --git a/contrib/gcc/config/i386/freebsd.h b/contrib/gcc/config/i386/freebsd.h index 4fc7a9a..1bfde2f 100644 --- a/contrib/gcc/config/i386/freebsd.h +++ b/contrib/gcc/config/i386/freebsd.h @@ -22,111 +22,86 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* $FreeBSD$ */ -#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)"); +#undef CC1_SPEC +#define CC1_SPEC "%(cc1_cpu) %{profile:-p}" -/* Override the default comment-starter of "/". */ -#undef ASM_COMMENT_START -#define ASM_COMMENT_START "#" +#undef ASM_SPEC +#define ASM_SPEC "%{v*: -v}" -#undef ASM_APP_ON -#define ASM_APP_ON "#APP\n" +/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support + for the special GCC options -static and -shared, which allow us to + link things in one of these three modes by applying the appropriate + combinations of options at link-time. We like to support here for + as many of the other GNU linker options as possible. But I don't + have the time to search for those flags. I am sure how to add + support for -soname shared_object_name. H.J. -#undef ASM_APP_OFF -#define ASM_APP_OFF "#NO_APP\n" + When the -shared link option is used a final link is not being + done. */ -#undef DBX_REGISTER_NUMBER -#define DBX_REGISTER_NUMBER(n) \ - (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) +#undef LINK_SPEC +#define LINK_SPEC "\ + %{p:%nconsider using `-pg' instead of `-p' with gprof(1) } \ + %{Wl,*:%*} \ + %{v:-V} \ + %{assert*} %{R*} %{rpath*} %{defsym*} \ + %{shared:-Bshareable %{h*} %{soname*}} \ + %{!shared: \ + %{!static: \ + %{rdynamic: -export-dynamic} \ + %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \ + %{static:-Bstatic}} \ + %{symbolic:-Bsymbolic}" -#undef NO_PROFILE_COUNTERS -#define NO_PROFILE_COUNTERS 1 +/* Reset our STARTFILE_SPEC which was properly set in config/freebsd.h + but trashed by config/<cpu>/<file.h>. */ -/* Tell final.c that we don't need a label passed to mcount. */ +#undef STARTFILE_SPEC +#define STARTFILE_SPEC FBSD_STARTFILE_SPEC -#undef MCOUNT_NAME -#define MCOUNT_NAME ".mcount" +/* Provide an ENDFILE_SPEC appropriate for FreeBSD/i386. */ + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC FBSD_ENDFILE_SPEC -/* Make gcc agree with <machine/ansi.h>. */ + +/************************[ Target stuff ]***********************************/ + +/* Define the actual types of some ANSI-mandated types. + Needs to agree with <machine/ansi.h>. GCC defaults come from c-decl.c, + c-common.c, and config/<arch>/<arch>.h. */ #undef SIZE_TYPE #define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int") - + #undef PTRDIFF_TYPE #define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int") - + #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE (TARGET_64BIT ? 32 : BITS_PER_WORD) -#undef SUBTARGET_EXTRA_SPECS /* i386.h bogusly defines it. */ +#undef SUBTARGET_EXTRA_SPECS /* i386.h bogusly defines it. */ #define SUBTARGET_EXTRA_SPECS \ { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER } - -/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add - the magical crtbegin.o file (see crtstuff.c) which provides part - of the support for getting C++ file-scope static object constructed - before entering `main'. */ - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC \ - "%{!shared: \ - %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ - %{!p:%{profile:gcrt1.o%s} \ - %{!profile:crt1.o%s}}}} \ - crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" - -/* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on - the magical crtend.o file (see crtstuff.c) which provides part of - the support for getting C++ file-scope static object constructed - before entering `main', followed by a normal "finalizer" file, - `crtn.o'. */ - -#undef ENDFILE_SPEC -#define ENDFILE_SPEC \ - "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" - -/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support - for the special GCC options -static and -shared, which allow us to - link things in one of these three modes by applying the appropriate - combinations of options at link-time. We like to support here for - as many of the other GNU linker options as possible. But I don't - have the time to search for those flags. I am sure how to add - support for -soname shared_object_name. H.J. - I took out %{v:%{!V:-V}}. It is too much :-(. They can use - -Wl,-V. +#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD/ELF)"); - When the -shared link option is used a final link is not being - done. */ +#define MASK_PROFILER_EPILOGUE 010000000000 -#undef LINK_SPEC -#define LINK_SPEC "\ - %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \ - %{Wl,*:%*} \ - %{v:-V} \ - %{assert*} %{R*} %{rpath*} %{defsym*} \ - %{shared:-Bshareable %{h*} %{soname*}} \ - %{!shared: \ - %{!static: \ - %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \ - %{static:-Bstatic}} \ - %{symbolic:-Bsymbolic}" - -/* A C statement to output to the stdio stream FILE an assembler - command to advance the location counter to a multiple of 1<<LOG - bytes if it is within MAX_SKIP bytes. +#define TARGET_PROFILER_EPILOGUE (target_flags & MASK_PROFILER_EPILOGUE) +#define TARGET_ELF 1 - This is used to align code labels according to Intel recommendations. */ +#undef SUBTARGET_SWITCHES +#define SUBTARGET_SWITCHES \ + { "profiler-epilogue", MASK_PROFILER_EPILOGUE, "Function profiler epilogue"}, \ + { "no-profiler-epilogue", -MASK_PROFILER_EPILOGUE, "No function profiler epilogue"}, -#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN -#undef ASM_OUTPUT_MAX_SKIP_ALIGN -#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \ - if ((LOG) != 0) { \ - if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ - else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ - } -#endif +/* This goes away when the math emulator is fixed. */ +#undef TARGET_SUBTARGET_DEFAULT +#define TARGET_SUBTARGET_DEFAULT \ + (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387) /* Don't default to pcc-struct-return, we want to retain compatibility with older gcc versions AND pcc-struct-return is nonreentrant. @@ -140,3 +115,156 @@ Boston, MA 02111-1307, USA. */ compiler get the contents of <float.h> and std::numeric_limits correct. */ #undef TARGET_96_ROUND_53_LONG_DOUBLE #define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT) + +/* Tell final.c that we don't need a label passed to mcount. */ +#define NO_PROFILE_COUNTERS 1 + +/* Output assembler code to FILE to begin profiling of the current function. + LABELNO is an optional label. */ + +#undef MCOUNT_NAME +#define MCOUNT_NAME ".mcount" + +/* Output assembler code to FILE to end profiling of the current function. */ + +#undef FUNCTION_PROFILER_EPILOGUE /* BDE will need to fix this. */ + + +/************************[ Assembler stuff ]********************************/ + +/* Override the default comment-starter of "/" from unix.h. */ +#undef ASM_COMMENT_START +#define ASM_COMMENT_START "#" + +/* Override the default comment-starter of "/APP" from unix.h. */ +#undef ASM_APP_ON +#define ASM_APP_ON "#APP\n" +#undef ASM_APP_OFF +#define ASM_APP_OFF "#NO_APP\n" + +/* XXX:DEO do we still need this override to defaults.h ?? */ +/* This is how to output a reference to a user-level label named NAME. */ +#undef ASM_OUTPUT_LABELREF +#define ASM_OUTPUT_LABELREF(FILE, NAME) \ + do { \ + const char *xname = (NAME); \ + /* Hack to avoid writing lots of rtl in \ + FUNCTION_PROFILER_EPILOGUE (). */ \ + if (*xname == '.' && strcmp(xname + 1, "mexitcount") == 0) \ + { \ + if (flag_pic) \ + fprintf ((FILE), "*%s@GOT(%%ebx)", xname); \ + else \ + fprintf ((FILE), "%s", xname); \ + } \ + else \ + { \ + if (xname[0] == '%') \ + xname += 2; \ + if (xname[0] == '*') \ + xname += 1; \ + else \ + fputs (user_label_prefix, FILE); \ + fputs (xname, FILE); \ + } \ +} while (0) + +/* This is how to hack on the symbol code of certain relcalcitrant + symbols to modify their output in output_pic_addr_const (). */ + +#undef ASM_HACK_SYMBOLREF_CODE /* BDE will need to fix this. */ + +#undef ASM_OUTPUT_ALIGN +#define ASM_OUTPUT_ALIGN(FILE, LOG) \ + do { \ + if ((LOG)!=0) { \ + if (in_text_section()) \ + fprintf ((FILE), "\t.p2align %d,0x90\n", (LOG)); \ + else \ + fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ + } \ + } while (0) + +/* A C statement to output to the stdio stream FILE an assembler + command to advance the location counter to a multiple of 1<<LOG + bytes if it is within MAX_SKIP bytes. + + This is used to align code labels according to Intel recommendations. */ + +/* XXX configuration of this is broken in the same way as HAVE_GAS_SHF_MERGE, + but it is easier to fix in an MD way. */ + +#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN +#undef ASM_OUTPUT_MAX_SKIP_ALIGN +#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \ + do { \ + if ((LOG) != 0) { \ + if ((MAX_SKIP) == 0) \ + fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ + else \ + fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ + } \ + } while (0) +#endif + +/* If defined, a C expression whose value is a string containing the + assembler operation to identify the following data as + uninitialized global data. If not defined, and neither + `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined, + uninitialized global data will be output in the data section if + `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be + used. */ +#undef BSS_SECTION_ASM_OP +#define BSS_SECTION_ASM_OP "\t.section\t.bss" + +/* Like `ASM_OUTPUT_BSS' except takes the required alignment as a + separate, explicit argument. If you define this macro, it is used + in place of `ASM_OUTPUT_BSS', and gives you more flexibility in + handling the required alignment of the variable. The alignment is + specified as the number of bits. + + Try to use function `asm_output_aligned_bss' defined in file + `varasm.c' when defining this macro. */ +#undef ASM_OUTPUT_ALIGNED_BSS +#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ + asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) + +/************************[ Debugger stuff ]*********************************/ + +#undef DBX_REGISTER_NUMBER +#define DBX_REGISTER_NUMBER(n) (TARGET_64BIT ? dbx64_register_map[n] \ + : (write_symbols == DWARF2_DEBUG \ + || write_symbols == DWARF_DEBUG) \ + ? svr4_dbx_register_map[(n)] \ + : dbx_register_map[(n)]) + +/* The same functions are used to creating the DWARF2 debug info and C++ + unwind info (except.c). Regardless of the debug format requested, the + register numbers used in exception unwinding sections still have to be + DWARF compatible. IMO the GCC folks may be abusing the DBX_REGISTER_NUMBER + macro to mean too much. */ +#define DWARF_FRAME_REGNUM(n) (TARGET_64BIT ? dbx64_register_map[n] \ + : svr4_dbx_register_map[(n)]) + +/* stabs-in-elf has offsets relative to function beginning */ +#undef DBX_OUTPUT_LBRAC +#define DBX_OUTPUT_LBRAC(FILE, NAME) \ + do { \ + fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_LBRAC); \ + assemble_name (asmfile, NAME); \ + fputc ('-', asmfile); \ + assemble_name (asmfile, \ + XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \ + fprintf (asmfile, "\n"); \ + } while (0) + +#undef DBX_OUTPUT_RBRAC +#define DBX_OUTPUT_RBRAC(FILE, NAME) \ + do { \ + fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_RBRAC); \ + assemble_name (asmfile, NAME); \ + fputc ('-', asmfile); \ + assemble_name (asmfile, \ + XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \ + fprintf (asmfile, "\n"); \ + } while (0) diff --git a/contrib/gcc/config/i386/freebsd64.h b/contrib/gcc/config/i386/freebsd64.h index 19e9bc2..473ef2f 100644 --- a/contrib/gcc/config/i386/freebsd64.h +++ b/contrib/gcc/config/i386/freebsd64.h @@ -19,10 +19,23 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* $FreeBSD$ */ + #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (FreeBSD/x86-64 ELF)"); +#undef FBSD_TARGET_CPU_CPP_BUILTINS +#define FBSD_TARGET_CPU_CPP_BUILTINS() \ + do \ + { \ + if (TARGET_64BIT) \ + { \ + builtin_define ("__LP64__"); \ + } \ + } \ + while (0) + #define SUBTARGET_EXTRA_SPECS \ { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER } diff --git a/contrib/gcc/config/i386/i386.c b/contrib/gcc/config/i386/i386.c index e6f71b4..d0040fb 100644 --- a/contrib/gcc/config/i386/i386.c +++ b/contrib/gcc/config/i386/i386.c @@ -19,6 +19,10 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* $FreeBSD$ */ + + #include "config.h" #include "system.h" #include "coretypes.h" @@ -4899,7 +4903,7 @@ output_set_got (rtx dest) if (!flag_pic || TARGET_DEEP_BRANCH_PREDICTION) output_asm_insn ("add{l}\t{%1, %0|%0, %1}", xops); else if (!TARGET_MACHO) - output_asm_insn ("add{l}\t{%1+[.-%a2], %0|%0, %1+(.-%a2)}", xops); + output_asm_insn ("add{l}\t{%1+[.-%a2], %0|%0, %a1+(.-%a2)}", xops); return ""; } @@ -12643,6 +12647,7 @@ ix86_constant_alignment (tree exp, int align) return 128; } else if (!optimize_size && TREE_CODE (exp) == STRING_CST + && !TARGET_NO_ALIGN_LONG_STRINGS && TREE_STRING_LENGTH (exp) >= 31 && align < BITS_PER_WORD) return BITS_PER_WORD; @@ -13956,7 +13961,6 @@ ix86_expand_unop_builtin (enum insn_code icode, tree arglist, if (! target || GET_MODE (target) != tmode - || (do_load && GET_CODE (target) == MEM) || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) target = gen_reg_rtx (tmode); if (do_load) diff --git a/contrib/gcc/config/i386/i386.h b/contrib/gcc/config/i386/i386.h index 8a912d5..6afc3ac 100644 --- a/contrib/gcc/config/i386/i386.h +++ b/contrib/gcc/config/i386/i386.h @@ -133,6 +133,7 @@ extern int target_flags; /* ... overlap with subtarget options starts by 0x04000000. */ #define MASK_NO_RED_ZONE 0x04000000 /* Do not use red zone */ +#define MASK_NO_ALIGN_LONG_STRINGS 0x08000000 /* Do not align long strings specially */ /* Use the floating point instructions */ #define TARGET_80387 (target_flags & MASK_80387) @@ -313,6 +314,8 @@ extern int x86_prefetch_sse; #define TARGET_RED_ZONE (!(target_flags & MASK_NO_RED_ZONE)) +#define TARGET_NO_ALIGN_LONG_STRINGS (target_flags & MASK_NO_ALIGN_LONG_STRINGS) + #define TARGET_USE_MS_BITFIELD_LAYOUT (target_flags & MASK_MS_BITFIELD_LAYOUT) #define TARGET_GNU_TLS (ix86_tls_dialect == TLS_DIALECT_GNU) @@ -421,6 +424,10 @@ extern int x86_prefetch_sse; N_("Use red-zone in the x86-64 code") }, \ { "no-red-zone", MASK_NO_RED_ZONE, \ N_("Do not use red-zone in the x86-64 code") }, \ + { "no-align-long-strings", MASK_NO_ALIGN_LONG_STRINGS, \ + N_("Do not align long strings specially") }, \ + { "align-long-strings", -MASK_NO_ALIGN_LONG_STRINGS, \ + N_("Align strings longer than 30 on a 32-byte boundary") }, \ { "tls-direct-seg-refs", MASK_TLS_DIRECT_SEG_REFS, \ N_("Use direct references against %gs when accessing tls data") }, \ { "no-tls-direct-seg-refs", -MASK_TLS_DIRECT_SEG_REFS, \ @@ -607,8 +614,8 @@ extern int x86_prefetch_sse; else if (TARGET_ATHLON) \ { \ builtin_define ("__tune_athlon__"); \ - /* Only plain "athlon" lacks SSE. */ \ - if (last_tune_char != 'n') \ + /* Plain "athlon" & "athlon-tbird" lacks SSE. */ \ + if (last_tune_char != 'n' && last_tune_char != 'd') \ builtin_define ("__tune_athlon_sse__"); \ } \ else if (TARGET_K8) \ @@ -672,8 +679,8 @@ extern int x86_prefetch_sse; { \ builtin_define ("__athlon"); \ builtin_define ("__athlon__"); \ - /* Only plain "athlon" lacks SSE. */ \ - if (last_arch_char != 'n') \ + /* Plain "athlon" & "athlon-tbird" lacks SSE. */ \ + if (last_tune_char != 'n' && last_tune_char != 'd') \ builtin_define ("__athlon_sse__"); \ } \ else if (ix86_arch == PROCESSOR_K8) \ @@ -750,7 +757,9 @@ extern int x86_prefetch_sse; #define SHORT_TYPE_SIZE 16 #define INT_TYPE_SIZE 32 #define FLOAT_TYPE_SIZE 32 +#ifndef LONG_TYPE_SIZE #define LONG_TYPE_SIZE BITS_PER_WORD +#endif #define MAX_WCHAR_TYPE_SIZE 32 #define DOUBLE_TYPE_SIZE 64 #define LONG_LONG_TYPE_SIZE 64 diff --git a/contrib/gcc/config/i386/i386.md b/contrib/gcc/config/i386/i386.md index 0fbe00b..93d9dcd 100644 --- a/contrib/gcc/config/i386/i386.md +++ b/contrib/gcc/config/i386/i386.md @@ -1850,8 +1850,7 @@ (define_split [(set (match_operand:DI 0 "push_operand" "") (match_operand:DI 1 "immediate_operand" ""))] - "TARGET_64BIT && ((optimize > 0 && flag_peephole2) - ? flow2_completed : reload_completed) + "TARGET_64BIT && (flow2_completed || (reload_completed && !flag_peephole2)) && !symbolic_operand (operands[1], DImode) && !x86_64_immediate_operand (operands[1], DImode)" [(set (match_dup 0) (match_dup 1)) @@ -2106,8 +2105,7 @@ (define_split [(set (match_operand:DI 0 "memory_operand" "") (match_operand:DI 1 "immediate_operand" ""))] - "TARGET_64BIT && ((optimize > 0 && flag_peephole2) - ? flow2_completed : reload_completed) + "TARGET_64BIT && (flow2_completed || (reload_completed && !flag_peephole2)) && !symbolic_operand (operands[1], DImode) && !x86_64_immediate_operand (operands[1], DImode)" [(set (match_dup 2) (match_dup 3)) @@ -2174,10 +2172,11 @@ (match_operand:SF 1 "memory_operand" ""))] "reload_completed && GET_CODE (operands[1]) == MEM - && constant_pool_reference_p (operands[1])" + && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF + && CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0))" [(set (match_dup 0) (match_dup 1))] - "operands[1] = avoid_constant_pool_reference (operands[1]);") + "operands[1] = get_pool_constant (XEXP (operands[1], 0));") ;; %%% Kill this when call knows how to work this out. @@ -2890,10 +2889,11 @@ && GET_CODE (operands[1]) == MEM && (GET_MODE (operands[0]) == XFmode || GET_MODE (operands[0]) == SFmode || GET_MODE (operands[0]) == DFmode) - && constant_pool_reference_p (operands[1])" + && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF + && CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0))" [(set (match_dup 0) (match_dup 1))] { - rtx c = avoid_constant_pool_reference (operands[1]); + rtx c = get_pool_constant (XEXP (operands[1], 0)); rtx r = operands[0]; if (GET_CODE (r) == SUBREG) diff --git a/contrib/gcc/config/i386/x86-64.h b/contrib/gcc/config/i386/x86-64.h index 16b0633..6d1b811 100644 --- a/contrib/gcc/config/i386/x86-64.h +++ b/contrib/gcc/config/i386/x86-64.h @@ -19,6 +19,8 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* $FreeBSD$ */ + #undef ASM_COMMENT_START #define ASM_COMMENT_START "#" @@ -56,14 +58,6 @@ Boston, MA 02111-1307, USA. */ /* This is used to align code labels according to Intel recommendations. */ -#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \ - do { \ - if ((LOG) != 0) { \ - if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ - else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ - } \ - } while (0) - /* i386 System V Release 4 uses DWARF debugging info. x86-64 ABI specifies DWARF2. */ diff --git a/contrib/gcc/config/rs6000/freebsd.h b/contrib/gcc/config/rs6000/freebsd.h index fe6a801..196e5ac 100644 --- a/contrib/gcc/config/rs6000/freebsd.h +++ b/contrib/gcc/config/rs6000/freebsd.h @@ -24,6 +24,12 @@ #undef CPP_OS_DEFAULT_SPEC #define CPP_OS_DEFAULT_SPEC "%(cpp_os_freebsd)" +#undef CPP_OS_FREEBSD_SPEC +#define CPP_OS_FREEBSD_SPEC "\ + -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \ + -Acpu=powerpc -Amachine=powerpc \ + %{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} " + #undef STARTFILE_DEFAULT_SPEC #define STARTFILE_DEFAULT_SPEC "%(startfile_freebsd)" diff --git a/contrib/gcc/config/sparc/freebsd.h b/contrib/gcc/config/sparc/freebsd.h index c6f7398..b077423 100644 --- a/contrib/gcc/config/sparc/freebsd.h +++ b/contrib/gcc/config/sparc/freebsd.h @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +/* $FreeBSD$ */ #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ @@ -28,7 +29,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef CPP_CPU64_DEFAULT_SPEC #define CPP_CPU64_DEFAULT_SPEC \ - "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__" + "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__sparc__ -D__arch64__" + +#undef FBSD_TARGET_CPU_CPP_BUILTINS +#define FBSD_TARGET_CPU_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__LP64__"); \ + } \ + while (0) #define LINK_SPEC "%(link_arch) \ %{!mno-relax:%{!r:-relax}} \ diff --git a/contrib/gcc/config/x-linux b/contrib/gcc/config/x-linux deleted file mode 100644 index d14586b..0000000 --- a/contrib/gcc/config/x-linux +++ /dev/null @@ -1,4 +0,0 @@ -host-linux.o : $(srcdir)/config/host-linux.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h hosthooks.h hosthooks-def.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/host-linux.c |