[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#602099: gcc-4.4: next round of m68k specific patches, now with multi{arch,lib}



Hi,

this is the updated debdiff. We now do build multi{arch,lib} and select
the variants to build by patching gcc/config/m68k/* as you asked. The
aforementioned patch is also included.

Still no testsuite runs, but the patches are all either taken from newer
GCC or were seen as okay, considering I succeeded in bootstrapping gcc
with it.

bye,
//mirabilos
-- 
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh
diff -u gcc-4.4-4.4.5/debian/rules.defs gcc-4.4-4.4.5/debian/rules.defs
--- gcc-4.4-4.4.5/debian/rules.defs
+++ gcc-4.4-4.4.5/debian/rules.defs
@@ -1134,7 +1134,7 @@
 
 # GNU locales
 force_gnu_locales := yes
-locale_no_cpus := m68k
+locale_no_cpus :=
 locale_no_systems := knetbsd-gnu
 ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(locale_no_systems)))
   force_gnu_locales := disabled for system $(DEB_TARGET_GNU_SYSTEM)
diff -u gcc-4.4-4.4.5/debian/rules.patch gcc-4.4-4.4.5/debian/rules.patch
--- gcc-4.4-4.4.5/debian/rules.patch
+++ gcc-4.4-4.4.5/debian/rules.patch
@@ -235,8 +235,13 @@
 #endif
 
 ifeq ($(DEB_TARGET_ARCH),m68k)
+  debian_patches += m68k-multilib
   debian_patches += pr41302
   debian_patches += pr43804
+  debian_patches += pr37053
+  debian_patches += pr46179
+  debian_patches += pr39531
+  debian_patches += pr41064
 endif
 
 ifeq ($(DEB_TARGET_ARCH_OS),kfreebsd)
diff -u gcc-4.4-4.4.5/debian/changelog gcc-4.4-4.4.5/debian/changelog
--- gcc-4.4-4.4.5/debian/changelog
+++ gcc-4.4-4.4.5/debian/changelog
@@ -1,3 +1,19 @@
+gcc-4.4 (4.4.5-6+m68k.1) unreleased; urgency=low
+
+  * debian/rules2: Re-enable multi{arch,lib} on m68k.
+  * debian/patches/m68k-multilib.diff: new, select which multi{arch,lib}
+    targets to build: keep 680x0 drop cpu32/fidoa (possibly re-evaluated
+    later but [Bug gas/12180] suggests both do not run Linux anyway).
+  * debian/patches/pr37053.diff: new, backported from trunk.
+  * debian/patches/pr46179.diff: new, taken from GCC BZ.
+  * debian/patches/pr39531.diff: new, taken from git URL from fthain.
+  * debian/patches/pr41064.diff: new, backported from trunk.
+  * debian/rules.patch: Add m68k-multilib, pr37053, pr46179, pr39531,
+    pr41064 on m68k. (pr37053 and pr41064 go together to avoid regressions.)
+  * debian/rules.defs: remove m68k from locale_no_cpus.
+
+ -- Thorsten Glaser <tg@mirbsd.de>  Wed, 03 Nov 2010 21:57:06 +0000
+
 gcc-4.4 (4.4.5-6) unstable; urgency=low
 
   * Update to SVN 20101029 from the gcc-4_4-branch (r166075).
diff -u gcc-4.4-4.4.5/debian/rules2 gcc-4.4-4.4.5/debian/rules2
--- gcc-4.4-4.4.5/debian/rules2
+++ gcc-4.4-4.4.5/debian/rules2
@@ -343,14 +343,6 @@
   CONFARGS += --with-multilib-list=m4,m4-nofpu --with-cpu=sh4
 endif
 
-ifneq (,$(findstring m68k-linux,$(DEB_TARGET_GNU_TYPE)))
-# Works in theory, but libfortran/mfidoa cannot be built because
-# the system headers contain incompatible inline assembly code -
-# at least for the pre-TLS libc; we'll need to recheck once past
-# newer eglibc's usable, and decide which to build anyway.
-  CONFARGS += --disable-multiarch --disable-multilib
-endif
-
 ifeq ($(DEB_TARGET_ARCH_OS),linux)
   ifneq (,$(findstring $(DEB_TARGET_ARCH), alpha powerpc ppc64 s390 s390x sparc sparc64))
     ifeq ($(DEB_TARGET_ARCH),alpha)
only in patch2:
unchanged:
--- gcc-4.4-4.4.5.orig/debian/patches/pr37053.diff
+++ gcc-4.4-4.4.5/debian/patches/pr37053.diff
@@ -0,0 +1,57 @@
+# DP: Work around PR middle-end/37053 by backporting a trunk commit
+# DP: Combine with pr41064.diff to avoid regressions!
+
+gcc/
+
+2009-08-10  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
+
+	PR target/37053
+	* reload1.c (reload_as_needed): Use cancel_changes to completely
+	undo a failed replacement attempt.
+
+Index: trunk/gcc/reload1.c
+===================================================================
+--- a/src/gcc/reload1.c	(revision 150625)
++++ b/src/gcc/reload1.c	(revision 150626)
+@@ -4304,31 +4304,25 @@
+ 			    continue;
+ 			  if (n == 1)
+ 			    {
+-			      n = validate_replace_rtx (reload_reg,
+-							gen_rtx_fmt_e (code,
+-								       mode,
+-								       reload_reg),
+-							p);
++			      rtx replace_reg
++				= gen_rtx_fmt_e (code, mode, reload_reg);
+ 
++			      validate_replace_rtx_group (reload_reg,
++							  replace_reg, p);
++			      n = verify_changes (0);
++
+ 			      /* We must also verify that the constraints
+ 				 are met after the replacement.  */
+ 			      extract_insn (p);
+ 			      if (n)
+ 				n = constrain_operands (1);
+-			      else
+-				break;
+ 
+ 			      /* If the constraints were not met, then
+-				 undo the replacement.  */
++				 undo the replacement, else confirm it.  */
+ 			      if (!n)
+-				{
+-				  validate_replace_rtx (gen_rtx_fmt_e (code,
+-								       mode,
+-								       reload_reg),
+-							reload_reg, p);
+-				  break;
+-				}
+-
++				cancel_changes (0);
++			      else
++				confirm_change_group ();
+ 			    }
+ 			  break;
+ 			}
only in patch2:
unchanged:
--- gcc-4.4-4.4.5.orig/debian/patches/pr39531.diff
+++ gcc-4.4-4.4.5/debian/patches/pr39531.diff
@@ -0,0 +1,58 @@
+# DP: Fix for PR39531, added by request of Finn Thain
+
+From: schwab <schwab@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Mon, 18 May 2009 15:36:18 +0000 (+0000)
+Subject: PR target/39531
+X-Git-Url: http://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=f422081b5615ce3dc436377be3ce7da04b8fbc52
+
+PR target/39531
+* config/m68k/m68k.c (output_andsi3): Mask off sign bit copies
+before calling exact_log2.
+(output_iorsi3): Likewise.
+(output_xorsi3): Likewise.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147664 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+
+gcc/
+
+2009-05-18  Andreas Schwab  <schwab@linux-m68k.org>
+
+	PR target/39531
+	* config/m68k/m68k.c (output_andsi3): Mask off sign bit copies
+	before calling exact_log2.
+	(output_iorsi3): Likewise.
+	(output_xorsi3): Likewise.
+
+diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
+index de20fdb..ec371e5 100644
+--- a/src/gcc/config/m68k/m68k.c
++++ b/src/gcc/config/m68k/m68k.c
+@@ -4829,7 +4829,7 @@ output_andsi3 (rtx *operands)
+       return "and%.w %2,%0";
+     }
+   if (GET_CODE (operands[2]) == CONST_INT
+-      && (logval = exact_log2 (~ INTVAL (operands[2]))) >= 0
++      && (logval = exact_log2 (~ INTVAL (operands[2]) & 0xffffffff)) >= 0
+       && (DATA_REG_P (operands[0])
+           || offsettable_memref_p (operands[0])))
+     {
+@@ -4866,7 +4866,7 @@ output_iorsi3 (rtx *operands)
+       return "or%.w %2,%0";
+     }
+   if (GET_CODE (operands[2]) == CONST_INT
+-      && (logval = exact_log2 (INTVAL (operands[2]))) >= 0
++      && (logval = exact_log2 (INTVAL (operands[2]) & 0xffffffff)) >= 0
+       && (DATA_REG_P (operands[0])
+ 	  || offsettable_memref_p (operands[0])))
+     {
+@@ -4901,7 +4901,7 @@ output_xorsi3 (rtx *operands)
+       return "eor%.w %2,%0";
+     }
+   if (GET_CODE (operands[2]) == CONST_INT
+-      && (logval = exact_log2 (INTVAL (operands[2]))) >= 0
++      && (logval = exact_log2 (INTVAL (operands[2]) & 0xffffffff)) >= 0
+       && (DATA_REG_P (operands[0])
+ 	  || offsettable_memref_p (operands[0])))
+     {
only in patch2:
unchanged:
--- gcc-4.4-4.4.5.orig/debian/patches/pr41064.diff
+++ gcc-4.4-4.4.5/debian/patches/pr41064.diff
@@ -0,0 +1,35 @@
+# DP: Work around PR middle-end/41064 by backporting a trunk commit
+# DP: Combine with pr37053.diff to avoid regressions!
+
+gcc/
+
+2009-08-14  Hans-Peter Nilsson  <hp@axis.com>
+
+	PR rtl-optimization/41064
+	* reload1.c (reload_as_needed): Don't call extract_insn
+	for known invalid replacements after calling
+	validate_replace_rtx_group and verify_changes.
+
+Index: gcc/reload1.c
+===================================================================
+--- a/src/gcc/reload1.c	(revision 150750)
++++ b/src/gcc/reload1.c	(revision 150751)
+@@ -4312,10 +4312,15 @@
+ 			      n = verify_changes (0);
+ 
+ 			      /* We must also verify that the constraints
+-				 are met after the replacement.  */
+-			      extract_insn (p);
++				 are met after the replacement.  Make sure
++				 extract_insn is only called for an insn
++				 where the replacements were found to be
++				 valid so far. */
+ 			      if (n)
+-				n = constrain_operands (1);
++				{
++				  extract_insn (p);
++				  n = constrain_operands (1);
++				}
+ 
+ 			      /* If the constraints were not met, then
+ 				 undo the replacement, else confirm it.  */
only in patch2:
unchanged:
--- gcc-4.4-4.4.5.orig/debian/patches/pr46179.diff
+++ gcc-4.4-4.4.5/debian/patches/pr46179.diff
@@ -0,0 +1,28 @@
+# DP: Possibly fix PR target/46179 with Attachment #22191 from Finn Thain
+
+--- a/src/gcc/config/m68k/m68k.c	2010-06-15 06:01:39.000000000 +1000
++++ b/src/gcc/config/m68k/m68k.c	2010-10-29 02:04:44.000000000 +1100
+@@ -3478,6 +3478,7 @@ handle_move_double (rtx operands[2],
+ 
+   /* Normal case: do the two words, low-numbered first.  */
+ 
++  m68k_final_prescan_insn (NULL, operands, 2);
+   handle_movsi (operands);
+ 
+   /* Do the middle one of the three words for long double */
+@@ -3488,6 +3489,7 @@ handle_move_double (rtx operands[2],
+       if (addreg1)
+ 	handle_reg_adjust (addreg1, 4);
+ 
++      m68k_final_prescan_insn (NULL, middlehalf, 2);
+       handle_movsi (middlehalf);
+     }
+ 
+@@ -3498,6 +3500,7 @@ handle_move_double (rtx operands[2],
+     handle_reg_adjust (addreg1, 4);
+ 
+   /* Do that word.  */
++  m68k_final_prescan_insn (NULL, latehalf, 2);
+   handle_movsi (latehalf);
+ 
+   /* Undo the adds we just did.  */
only in patch2:
unchanged:
--- gcc-4.4-4.4.5.orig/debian/patches/m68k-multilib.diff
+++ gcc-4.4-4.4.5/debian/patches/m68k-multilib.diff
@@ -0,0 +1,16 @@
+# DP: Select which multiarch/multilib targets to build.
+# DP: Apparently, cpu32 and fidoa (the other two) aren't
+# DP: classical m68k-linux targets, plus they trouble us.
+
+--- a/src/gcc/config/m68k/t-linux	2010-11-03 21:30:58.000000000 +0000
++++ b/src/gcc/config/m68k/t-linux	2010-11-03 21:31:38.000000000 +0000
+@@ -3,6 +3,9 @@ EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o
+ # Only include multilibs for CPUs with an MMU.
+ M68K_MLIB_CPU += && match(FLAGS, "FL_MMU")
+ 
++# Limit to "classical" 680x0 CPUs with FPU and all bells and whistles.
++M68K_MLIB_CPU += && match(MLIB, "^68")
++
+ # This rule uses MULTILIB_MATCHES to generate a definition of
+ # SYSROOT_SUFFIX_SPEC.
+ sysroot-suffix.h: $(srcdir)/config/m68k/print-sysroot-suffix.sh

Reply to: