summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-05-24 20:58:47 +0000
committerpeter <peter@FreeBSD.org>2003-05-24 20:58:47 +0000
commit6f281cac4642de882563b3c87f62aa6d9f0785c9 (patch)
tree2cf84d1950e04e5b9a7118ec721d6be42e0ee499 /gnu
parent36470ce9b8bef70d3858dd33d7c354f3c79e6ff5 (diff)
downloadFreeBSD-src-6f281cac4642de882563b3c87f62aa6d9f0785c9.zip
FreeBSD-src-6f281cac4642de882563b3c87f62aa6d9f0785c9.tar.gz
Add a temporary indirect patch for gcc when targeting amd64. This is to
give the cvs tree a surviving a 'make world'. One of the two diff chunks is already in gcc-3.3, the other has been committed to gcc's HEAD and is in the pipeline for gcc-3.3.1 (but has not been committed yet). The first chunk simplifies an excessively complex assembler statement when generating switch jump tables. The use of '.' causes as(1) to choke on big files. Use a simpler form instead. This is only an issue for TARGET_64BIT mode. The second chunk fixes an internal compiler error when compiling libc/stdio/vfprinf.c. While this is supposedly only an issue for 64 bit mode, it does touch the 32 bit i386 code paths, so this patch is only applied for TARGET_ARCH == amd64 to keep the risks down. Breaking gcc at the 11th hour would suck. This will be removed when it is time to import gcc-3.3. Discussed with: kan Approved by: re (jhb)
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/cc/cc_int/Makefile15
-rw-r--r--gnu/usr.bin/cc/cc_int/amd64.patch54
2 files changed, 67 insertions, 2 deletions
diff --git a/gnu/usr.bin/cc/cc_int/Makefile b/gnu/usr.bin/cc/cc_int/Makefile
index ef892e7..bfc7b77 100644
--- a/gnu/usr.bin/cc/cc_int/Makefile
+++ b/gnu/usr.bin/cc/cc_int/Makefile
@@ -23,8 +23,19 @@ SRCS= c-common.c c-format.c \
toplev.c tree.c unroll.c varasm.c version.c xcoffout.c \
alias.c bitmap.c dyn-string.c \
gcse.c genrtl.c profile.c regmove.c varray.c \
- attribs.c cselib.c debug.c rtl-error.c tree-dump.c tree-inline.c \
- ${GCC_CPU}.c
+ attribs.c cselib.c debug.c rtl-error.c tree-dump.c tree-inline.c
+
+.if ${TARGET_ARCH} != "amd64"
+SRCS+= ${GCC_CPU}.c
+.else
+SRCS+= i386-hacked.c
+CLEANFILES+= i386-hacked.c
+
+i386-hacked.c: ${GCCDIR}/config/i386/i386.c amd64.patch
+ rm -f i386-hacked.c # in case p4 readonly copied
+ cp ${GCCDIR}/config/i386/i386.c i386-hacked.c
+ patch -b .orig < ${.CURDIR}/amd64.patch
+.endif
SRCS+= bb-reorder.c conflict.c ggc-common.c \
ggc-page.c ifcvt.c lists.c predict.c regrename.c resource.c sibcall.c \
diff --git a/gnu/usr.bin/cc/cc_int/amd64.patch b/gnu/usr.bin/cc/cc_int/amd64.patch
new file mode 100644
index 0000000..2c50780
--- /dev/null
+++ b/gnu/usr.bin/cc/cc_int/amd64.patch
@@ -0,0 +1,54 @@
+# $FreeBSD$
+# The first chunk is to stop gcc generating stupid assembler output
+# for jump tables. This change is already in gcc-3.3.
+# The second chunk is to stop gcc doing an ICE on libc/stdio/vfprintf.c.
+# This one has been committed to the gcc mainline and is due to go in
+# gcc-3.3.1, but is *not* in gcc-3.3-release. Its changelog:
+# * config/i386/i386.c (ix86_split_long_move): Fix base register
+# mode for XFmode splits for TARGET_64BIT.
+
+Index: i386-hacked.c
+===========================================================================
+--- i386-hacked.c 2003/05/24 10:50:22 #11
++++ i386-hacked.c 2003/05/24 10:50:22
+@@ -6764,7 +6764,7 @@
+ int value, rel;
+ {
+ if (TARGET_64BIT)
+- fprintf (file, "%s%s%d-.+(.-%s%d)\n",
++ fprintf (file, "%s%s%d-%s%d\n",
+ ASM_LONG, LPREFIX, value, LPREFIX, rel);
+ else if (HAVE_AS_GOTOFF_IN_DATA)
+ fprintf (file, "%s%s%d@GOTOFF\n", ASM_LONG, LPREFIX, value);
+@@ -8823,15 +8823,24 @@
+ Do an lea to the last part and use only one colliding move. */
+ else if (collisions > 1)
+ {
++ rtx base;
++
+ collisions = 1;
+- emit_insn (gen_rtx_SET (VOIDmode, part[0][nparts - 1],
+- XEXP (part[1][0], 0)));
+- part[1][0] = change_address (part[1][0],
+- TARGET_64BIT ? DImode : SImode,
+- part[0][nparts - 1]);
+- part[1][1] = adjust_address (part[1][0], VOIDmode, UNITS_PER_WORD);
++
++ base = part[0][nparts - 1];
++
++ /* Handle the case when the last part isn't valid for lea.
++ Happens in 64-bit mode storing the 12-byte XFmode. */
++ if (GET_MODE (base) != Pmode)
++ base = gen_rtx_REG (Pmode, REGNO (base));
++
++ emit_insn (gen_rtx_SET (VOIDmode, base, XEXP (part[1][0], 0)));
++ part[1][0] = replace_equiv_address (part[1][0], base);
++ part[1][1] = replace_equiv_address (part[1][1],
++ plus_constant (base, UNITS_PER_WORD));
+ if (nparts == 3)
+- part[1][2] = adjust_address (part[1][0], VOIDmode, 8);
++ part[1][2] = replace_equiv_address (part[1][2],
++ plus_constant (base, 8));
+ }
+ }
+
OpenPOWER on IntegriCloud