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

Bug#602099: gcc-4.4: next round of m68k specific patches



Source: gcc-4.4
Version: 4.4.5-5
Severity: wishlist
Tags: patch

Hi,

here’s the next round of m68k support. The patches have accumulated
by discussion on the mailing list; they are not yet regression te-
sted, but this is tracked by the submitters, and the binary packages
compiled from this work for me, better than the previous one.

• m68k now has an installable “locales” package
• pr41302 from #600835 did not apply cleanly, so avoid patching
  **/ChangeLog* in per-arch patches
• pr37053: new, backported from trunk:
  ‣ fixes ICE in reload_cse_simplify_operands during libjpeg6b build
  ‣ kept as m68k only because it *might* regress on cris
• pr46179: new, taken from GCC BZ:
  ‣ fix invalid assembly being emitted (patch not applied in mainline
    yet, needs regression testing on m68k and coldfire, but needed to
    compile util-linux, at least)
• pr39531: new, taken from git URL from Finn Thain by his suggestion
  ‣ “Mask off sign bit copies before calling exact_log2.”

All pr*.diff are applied for m68k only, again. We have not yet decided
what to do about multiarch/-lib but will do so later.

Thanks!
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
@@ -237,6 +237,9 @@
 ifeq ($(DEB_TARGET_ARCH),m68k)
   debian_patches += pr41302
   debian_patches += pr43804
+  debian_patches += pr37053
+  debian_patches += pr46179
+  debian_patches += pr39531
 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,15 @@
+gcc-4.4 (4.4.5-5+m68k.1) unreleased; urgency=low
+
+  * debian/patches/pr41302.diff: make apply by not patching **/ChangeLog*.
+  * 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/rules.patch: Add pr37053 (m68k only, to prevent a potential
+    regression on cris) and pr46179, pr39531 on m68k.
+  * debian/rules.defs: remove m68k from locale_no_cpus.
+
+ -- Thorsten Glaser <tg@mirbsd.de>  Sat, 30 Oct 2010 14:45:32 +0000
+
 gcc-4.4 (4.4.5-5) unstable; urgency=medium
 
   * Update to SVN 20101021 from the gcc-4_4-branch (r165755, 4.4.5 release
diff -u gcc-4.4-4.4.5/debian/patches/pr41302.diff gcc-4.4-4.4.5/debian/patches/pr41302.diff
--- gcc-4.4-4.4.5/debian/patches/pr41302.diff
+++ gcc-4.4-4.4.5/debian/patches/pr41302.diff
@@ -18,21 +18,21 @@
 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153890 138bc75d-0d04-0410-961f-82ee72b054a4
 ---
 
---- a/src/gcc/ChangeLog	2010-10-14 15:23:18.000000000 +0000
-+++ b/src/gcc/ChangeLog	2010-10-14 16:42:48.000000000 +0000
-@@ -1,3 +1,12 @@
-+2010-10-14  Thorsten Glaser  <tg@debian.org>
-+
-+	Backport from mainline
-+	2009-11-04  Maxim Kuvyrkov  <maxim@codesourcery.com>
-+
-+	PR target/41302
-+	* config/m68k/m68k.c (m68k_reg_present_p): New static function.
-+	(m68k_ok_for_sibcall_p): Handle different result return locations.
-+
- 2010-10-07  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
- 
- 	PR target/45820
+#--- a/src/gcc/ChangeLog	2010-10-14 15:23:18.000000000 +0000
+#+++ b/src/gcc/ChangeLog	2010-10-14 16:42:48.000000000 +0000
+#@@ -1,3 +1,12 @@
+#+2010-10-14  Thorsten Glaser  <tg@debian.org>
+#+
+#+	Backport from mainline
+#+	2009-11-04  Maxim Kuvyrkov  <maxim@codesourcery.com>
+#+
+#+	PR target/41302
+#+	* config/m68k/m68k.c (m68k_reg_present_p): New static function.
+#+	(m68k_ok_for_sibcall_p): Handle different result return locations.
+#+
+# 2010-10-07  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+# 
+# 	PR target/45820
 --- a/src/gcc/config/m68k/m68k.c	2010-10-14 15:23:42.000000000 +0000
 +++ b/src/gcc/config/m68k/m68k.c	2010-10-14 16:43:31.000000000 +0000
 @@ -1383,6 +1383,30 @@ flags_in_68881 (void)
@@ -103,20 +103,20 @@
  rtx
  m68k_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED)
  {
---- a/src/gcc/testsuite/ChangeLog	2010-10-14 15:23:19.000000000 +0000
-+++ b/src/gcc/testsuite/ChangeLog	2010-10-14 16:44:21.000000000 +0000
-@@ -1,3 +1,11 @@
-+2010-10-14  Thorsten Glaser  <tg@debian.org>
-+
-+	Backport from mainline
-+	2009-11-04  Carlos O'Donell  <carlos@codesourcery.com>
-+
-+	PR target/41302
-+	* gcc.target/m68k/pr41302.c: New test.
-+
- 2010-10-10  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
- 
- 	Backport from mainline
+#--- a/src/gcc/testsuite/ChangeLog	2010-10-14 15:23:19.000000000 +0000
+#+++ b/src/gcc/testsuite/ChangeLog	2010-10-14 16:44:21.000000000 +0000
+#@@ -1,3 +1,11 @@
+#+2010-10-14  Thorsten Glaser  <tg@debian.org>
+#+
+#+	Backport from mainline
+#+	2009-11-04  Carlos O'Donell  <carlos@codesourcery.com>
+#+
+#+	PR target/41302
+#+	* gcc.target/m68k/pr41302.c: New test.
+#+
+# 2010-10-10  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+# 
+# 	Backport from mainline
 diff --git a/gcc/testsuite/gcc.target/m68k/pr41302.c b/gcc/testsuite/gcc.target/m68k/pr41302.c
 new file mode 100644
 index 0000000..8e1c310
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,63 @@
+# DP: Work around PR middle-end/37053 by backporting a trunk commit
+# DP: Keep this m68k only, cris might regress with this applied
+
+#Index: trunk/gcc/ChangeLog
+#===================================================================
+#--- a/src/gcc/ChangeLog	(revision 150625)
+#+++ b/src/gcc/ChangeLog	(revision 150626)
+#@@ -1,3 +1,9 @@
+#+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.
+#+
+# 2009-08-10  Richard Guenther  <rguenther@suse.de>
+# 
+# 	PR middle-end/41006
+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,66 @@
+# DP: Fix for PR39531, added by request of Finn Thain
+# DP: As usual, patches to **/ChangeLog* commented out to make
+# DP: this apply easier
+
+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
+---
+
+diff --git a/gcc/ChangeLog b/gcc/ChangeLog
+index 575773f..7b2a7bf 100644
+#--- a/src/gcc/ChangeLog
+#+++ b/src/gcc/ChangeLog
+#@@ -1,3 +1,11 @@
+#+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.
+#+
+# 2009-05-18  Kaz Kojima  <kkojima@gcc.gnu.org>
+# 
+# 	* config/sh/sh.c (expand_cbranchdi4): Use a scratch register
+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/pr46179.diff
+++ gcc-4.4-4.4.5/debian/patches/pr46179.diff
@@ -0,0 +1,29 @@
+# DP: Possibly fix PR target/46179 with Attachment #22191 from Finn Thain
+# XXX needs to be regression tested on coldfire
+
+--- 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.  */

Reply to: