aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '2.95.3/gentoo/42_all_debian-gcc-m68k-pic.patch')
-rw-r--r--2.95.3/gentoo/42_all_debian-gcc-m68k-pic.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/2.95.3/gentoo/42_all_debian-gcc-m68k-pic.patch b/2.95.3/gentoo/42_all_debian-gcc-m68k-pic.patch
new file mode 100644
index 0000000..36c5c7e
--- /dev/null
+++ b/2.95.3/gentoo/42_all_debian-gcc-m68k-pic.patch
@@ -0,0 +1,62 @@
+#! /bin/sh -e
+
+# DP: Two patches by Andreas Schwab to fix -fpic and loop optimization.
+# DP: Another patch by Andreas Schwab to fix %a5 restauration in some cases.
+
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+ pdir="-d $3"
+elif [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;;
+ -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+------------------------------------------------------------------------------
+--- gcc/config/m68k/m68k.c~ Mon Aug 2 06:51:08 1999
++++ gcc/config/m68k/m68k.c Fri Oct 22 11:47:09 1999
+@@ -356,7 +356,7 @@
+ mask &= ~ (1 << (15 - FRAME_POINTER_REGNUM));
+ num_saved_regs--;
+ }
+- if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
++ if (flag_pic && current_function_uses_pic_offset_table)
+ {
+ mask |= 1 << (15 - PIC_OFFSET_TABLE_REGNUM);
+ num_saved_regs++;
+@@ -493,7 +493,10 @@
+ for (regno = 0 ; regno < FIRST_PSEUDO_REGISTER ; regno++)
+ if (regs_ever_live[regno] && ! call_used_regs[regno])
+ return 0;
+-
++
++ if (flag_pic && current_function_uses_pic_offset_table)
++ return 0;
++
+ return 1;
+ }
+
+@@ -568,7 +571,7 @@
+ nregs++;
+ mask |= 1 << regno;
+ }
+- if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
++ if (flag_pic && current_function_uses_pic_offset_table)
+ {
+ nregs++;
+ mask |= 1 << PIC_OFFSET_TABLE_REGNUM;
+@@ -1334,8 +1337,6 @@
+ gen_rtx_PLUS (Pmode,
+ pic_offset_table_rtx, orig));
+ current_function_uses_pic_offset_table = 1;
+- if (reload_in_progress)
+- regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1;
+ RTX_UNCHANGING_P (pic_ref) = 1;
+ emit_move_insn (reg, pic_ref);
+ return reg;