Matthias Klose dixit:
>Am 23.08.2013 00:26, schrieb Thorsten Glaser:
>> --- a/src/gcc/common.opt
>> +++ b/src/gcc/common.opt
>> @@ -858,7 +858,7 @@ Common Report Var(flag_asynchronous_unwi
>> Generate unwind tables that are exact at each instruction boundary
>>
>> fauto-inc-dec
>> -Common Report Var(flag_auto_inc_dec) Init(1)
>> +Common Report Var(flag_auto_inc_dec) Init(0)
>> Generate auto-inc/dec instructions
>>
>> ; -fcheck-bounds causes gcc to generate array bounds checks.
>I think, setting the flag for the option to 0 as the default, and applying this
>for m68k only would be the second best option, provided that you cannot find
>out
>how to implement Mikael's suggestion.
It turns out that there is no pre-options target hook, only a post
one, so this is what I eventually did.
I also integrated the other patches Mikael suggested, as well as
two more fixes for issues that popped up in the meantime (boost1.54
ICE, and reloction errors in smokeqt and python-qt4 that are new
and appear to be due to the size (-fpic/-fPIC issue)).
The .debdiff is attached, for your convenience to read through and
comment on it already. I’m currently building this, and I’ll report
success (or not) in about a week (since it takes at least five days
for this to compile, from experience).
Changelog:
+ * m68k-ada.diff: Add gcc-4.8.0-m68k-ada-pr48835-2.patch and
+ gcc-4.8.0-m68k-ada-pr51483.patch by Mikael Pettersson, to
+ fix more CC0-specific and m68k/Ada-specific problems.
Two suggested patches, which I just folded into m68k-ada.diff
for simplicity. Applied on m68k only, as it was previously.
+ * m68k-picflag.diff: New, backport from trunk, by Andreas Schwab,
+ to avoid relocation errors when linking big shared objects.
+ * pr58369.diff: New, backport from trunk, by Jeffrey A. Law,
+ to fix ICE while building boost 1.54.
The aforementioned two new issues. Always applied: m68k-picflag
doesn’t affect other platforms, and pr58369 is “always applied”
in GCC trunk too, but if you disagree with this, feel free to
apply it m68k only.
+ * pr52306.diff: Supersedes pr52306-retry-hack.diff (in debports
+ unreleased), disables -fauto-inc-dec by default on m68k to
+ work around ICE when building C++ code (e.g. Qt-related).
As discussed above: changing the default, m68k only.
+ * rules.conf: Do not force libcloog-isl-dev (>= 0.18) on older
+ distribution releases that do not have this version yet.
ISTR writing about this already: as I regularily build cross
compilers for wheezy/amd64 which doesn’t have this version
yet, and all other new version dependencies are for sid and
whatever animal *buntu has as development version only (and
the changelog entry adding the 0.18 restriction indicates it
was only done to force the transition in Debian), I disabled
this for “older” releases, just like the mpc version dependency.
bye,
//mirabilos
--
„Also irgendwie hast du IMMER recht. Hier zuckelte gerade ein Triebwagen mit
der Aufschrift "Ostdeutsche Eisenbahn" durch Wuppertal. Ich glaubs machmal
nicht…“ -- Natureshadow, per SMS
„Hilf mir mal grad beim Denken“ -- Natureshadow, IRL, 2x
diff -u gcc-4.8-4.8.2/debian/changelog gcc-4.8-4.8.2/debian/changelog
--- gcc-4.8-4.8.2/debian/changelog
+++ gcc-4.8-4.8.2/debian/changelog
@@ -1,3 +1,20 @@
+gcc-4.8 (4.8.2-5+m68k.1) unreleased; urgency=low
+
+ * m68k-ada.diff: Add gcc-4.8.0-m68k-ada-pr48835-2.patch and
+ gcc-4.8.0-m68k-ada-pr51483.patch by Mikael Pettersson, to
+ fix more CC0-specific and m68k/Ada-specific problems.
+ * m68k-picflag.diff: New, backport from trunk, by Andreas Schwab,
+ to avoid relocation errors when linking big shared objects.
+ * pr58369.diff: New, backport from trunk, by Jeffrey A. Law,
+ to fix ICE while building boost 1.54.
+ * pr52306.diff: Supersedes pr52306-retry-hack.diff (in debports
+ unreleased), disables -fauto-inc-dec by default on m68k to
+ work around ICE when building C++ code (e.g. Qt-related).
+ * rules.conf: Do not force libcloog-isl-dev (>= 0.18) on older
+ distribution releases that do not have this version yet.
+
+ -- Thorsten Glaser <t...@mirbsd.de> Sun, 17 Nov 2013 00:41:12 +0100
+
gcc-4.8 (4.8.2-5) unstable; urgency=low
* Update to SVN 20131115 (r204839) from the gcc-4_8-branch.
diff -u gcc-4.8-4.8.2/debian/patches/m68k-ada.diff
gcc-4.8-4.8.2/debian/patches/m68k-ada.diff
--- gcc-4.8-4.8.2/debian/patches/m68k-ada.diff
+++ gcc-4.8-4.8.2/debian/patches/m68k-ada.diff
@@ -1,3 +1,11 @@
+gcc/
+
+2013-03-23 Mikael Pettersson <mi...@it.uu.se>
+
+ PR ada/48835
+ * cse.c (fold_rtx) <case CC0>: If prev_insn_cc0 is NULL
+ return the orginal expression x.
+
gcc/ada/
2011-10-12 Mikael Pettersson <mi...@it.uu.se>
@@ -11,6 +19,16 @@
Add Gnat_Malloc -> __gnat_malloc export.
* s-memory.ads: Remove Alloc -> __gnat_malloc export.
+2012-01-28 Mikael Pettersson <mi...@it.uu.se>
+
+ PR ada/51483
+ * gcc-interface/misc.c (enumerate_modes): Pass both precision and
+ bitsize to callback function. Adjust prototype of callback function.
+ gcc-interface/gigi.h (enumerate_modes): Likewise.
+ back_end.ads (Register_Type_Proc): Likewise.
+ cstand.adb (Register_Float_Type): Likewise. Use given precision
+ rather than deriving it incorrectly from size.
+
--- a/src/gcc/ada/gcc-interface/Makefile.in
+++ b/src/gcc/ada/gcc-interface/Makefile.in
@@ -1919,6 +1919,35 @@ ifeq ($(strip $(filter-out arm%-linux,$(
@@ -250,0 +269,106 @@
+--- a/src/gcc/cse.c
++++ b/src/gcc/cse.c
+@@ -3137,6 +3137,8 @@ fold_rtx (rtx x, rtx insn)
+
+ #ifdef HAVE_cc0
+ case CC0:
++ if (! prev_insn_cc0)
++ return x;
+ return prev_insn_cc0;
+ #endif
+
+--- a/src/gcc/ada/back_end.ads
++++ b/src/gcc/ada/back_end.ads
+@@ -55,6 +55,7 @@ package Back_End is
+ Complex : Boolean; -- True iff type has real and imaginary parts
+ Count : Natural; -- Number of elements in vector, 0 otherwise
+ Float_Rep : Float_Rep_Kind; -- Representation used for fpt type
++ Prec : Positive; -- Precision in bits
+ Size : Positive; -- Size of representation in bits
+ Alignment : Natural); -- Required alignment in bits
+ pragma Convention (C, Register_Type_Proc);
+--- a/src/gcc/ada/cstand.adb
++++ b/src/gcc/ada/cstand.adb
+@@ -151,6 +151,7 @@ package body CStand is
+ Complex : Boolean; -- True iff type has real and imaginary parts
+ Count : Natural; -- Number of elements in vector, 0 otherwise
+ Float_Rep : Float_Rep_Kind; -- Representation used for fpt type
++ Prec : Positive; -- Precision in bits
+ Size : Positive; -- Size of representation in bits
+ Alignment : Natural); -- Required alignment in bits
+ pragma Convention (C, Register_Float_Type);
+@@ -2014,6 +2015,7 @@ package body CStand is
+ Complex : Boolean;
+ Count : Natural;
+ Float_Rep : Float_Rep_Kind;
++ Prec : Positive;
+ Size : Positive;
+ Alignment : Natural)
+ is
+@@ -2063,7 +2065,7 @@ package body CStand is
+
+ else
+ Write_Str ("mod 2**");
+- Write_Int (Int (Size / Positive'Max (1, Count)));
++ Write_Int (Int (Prec / Positive'Max (1, Count)));
+ Write_Line (";");
+ end if;
+
+@@ -2100,7 +2102,7 @@ package body CStand is
+ Make_Name (Ent, T (1 .. Last));
+ Set_Scope (Ent, Standard_Standard);
+ Build_Float_Type (Ent, Esize, Float_Rep, Pos (Digs));
+- Set_RM_Size (Ent, UI_From_Int (Int (Size)));
++ Set_RM_Size (Ent, UI_From_Int (Int (Prec)));
+ Set_Alignment (Ent, UI_From_Int (Int (Alignment / 8)));
+
+ if No (Back_End_Float_Types) then
+--- a/src/gcc/ada/gcc-interface/gigi.h
++++ b/src/gcc/ada/gcc-interface/gigi.h
+@@ -1014,7 +1014,7 @@ extern Nat get_target_double_scalar_alig
+ /* This function is called by the front-end to enumerate all the supported
+ modes for the machine, as well as some predefined C types. */
+ extern void enumerate_modes (void (*f) (const char *, int, int, int, int, int,
+- int));
++ int, int));
+
+ #ifdef __cplusplus
+ }
+--- a/src/gcc/ada/gcc-interface/misc.c
++++ b/src/gcc/ada/gcc-interface/misc.c
+@@ -664,11 +664,12 @@ must_pass_by_ref (tree gnu_type)
+ COMPLEX_P nonzero is this represents a complex mode
+ COUNT count of number of items, nonzero for vector mode
+ FLOAT_REP Float_Rep_Kind for FP, otherwise undefined
++ PREC number of bits of precision
+ SIZE number of bits used to store data
+ ALIGN number of bits to which mode is aligned. */
+
+ void
+-enumerate_modes (void (*f) (const char *, int, int, int, int, int, int))
++enumerate_modes (void (*f) (const char *, int, int, int, int, int, int, int))
+ {
+ const tree c_types[]
+ = { float_type_node, double_type_node, long_double_type_node };
+@@ -751,9 +752,11 @@ enumerate_modes (void (*f) (const char *
+
+ if (TYPE_MODE (typ) == i)
+ {
++ int prec = TYPE_PRECISION (typ);
++ int size = float_p ? fp_prec_to_size (prec) : prec;
+ f (nam, digs, complex_p,
+ vector_p ? GET_MODE_NUNITS (i) : 0, float_rep,
+- TYPE_PRECISION (typ), TYPE_ALIGN (typ));
++ prec, size, TYPE_ALIGN (typ));
+ skip_p = true;
+ }
+ }
+@@ -763,7 +766,7 @@ enumerate_modes (void (*f) (const char *
+ if (!skip_p)
+ f (GET_MODE_NAME (i), digs, complex_p,
+ vector_p ? GET_MODE_NUNITS (i) : 0, float_rep,
+- GET_MODE_PRECISION (i), GET_MODE_ALIGNMENT (i));
++ GET_MODE_PRECISION (i), GET_MODE_BITSIZE (i), GET_MODE_ALIGNMENT
(i));
+ }
+ }
+
diff -u gcc-4.8-4.8.2/debian/rules.conf gcc-4.8-4.8.2/debian/rules.conf
--- gcc-4.8-4.8.2/debian/rules.conf
+++ gcc-4.8-4.8.2/debian/rules.conf
@@ -355,13 +355,14 @@
endif
PPL_BUILD_DEP = libisl-dev,
-CLOOG_BUILD_DEP = libcloog-isl-dev (>= 0.18),
# FIXME: currently not dl'opened.
#CLOOG_RUNTIME_DEP = libisl10, libcloog-isl4
ifneq (,$(filter $(distrelease),lenny etch squeeze wheezy dapper hardy jaunty
karmic lucid maverick natty oneiric precise quantal raring))
+ CLOOG_BUILD_DEP = libcloog-isl-dev,
MPC_BUILD_DEP = libmpc-dev,
else
+ CLOOG_BUILD_DEP = libcloog-isl-dev (>= 0.18),
MPC_BUILD_DEP = libmpc-dev (>= 1.0),
endif
diff -u gcc-4.8-4.8.2/debian/rules.parameters
gcc-4.8-4.8.2/debian/rules.parameters
--- gcc-4.8-4.8.2/debian/rules.parameters
+++ gcc-4.8-4.8.2/debian/rules.parameters
@@ -2,14 +2,14 @@
GCC_VERSION := 4.8.2
NEXT_GCC_VERSION := 4.8.3
BASE_VERSION := 4.8
-SOURCE_VERSION := 4.8.2-4ubuntu1
-DEB_VERSION := 4.8.2-4ubuntu1
-DEB_EVERSION := 1:4.8.2-4ubuntu1
-DEB_GDC_VERSION := 4.8.2-4ubuntu1
+SOURCE_VERSION := 4.8.2-5+m68k.1
+DEB_VERSION := 4.8.2-5+m68k.1
+DEB_EVERSION := 1:4.8.2-5+m68k.1
+DEB_GDC_VERSION := 4.8.2-5+m68k.1
DEB_SOVERSION := 4.8
DEB_SOEVERSION := 1:4.8
DEB_LIBGCC_SOVERSION :=
-DEB_LIBGCC_VERSION := 1:4.8.2-4ubuntu1
+DEB_LIBGCC_VERSION := 1:4.8.2-5+m68k.1
DEB_STDCXX_SOVERSION := 4.8
DEB_GCJ_SOVERSION := 4.8
PKG_GCJ_EXT := 14
diff -u gcc-4.8-4.8.2/debian/rules.patch gcc-4.8-4.8.2/debian/rules.patch
--- gcc-4.8-4.8.2/debian/rules.patch
+++ gcc-4.8-4.8.2/debian/rules.patch
@@ -81,6 +81,8 @@
kfreebsd-boehm-gc \
pr49847 \
libffi-m68k \
+ m68k-picflag \
+ pr58369 \
gdb_depends := $(shell dpkg -s gdb | grep '^Depends:.*libpython3')
ifneq (,$(findstring libpython3,$(gdb_depends)))
@@ -207,6 +209,7 @@
debian_patches += m68k-ada
debian_patches += m68k-revert-pr45144
debian_patches += pr52714
+ debian_patches += pr52306
endif
ifeq ($(DEB_TARGET_ARCH),powerpcspe)
only in patch2:
unchanged:
--- gcc-4.8-4.8.2.orig/debian/patches/m68k-picflag.diff
+++ gcc-4.8-4.8.2/debian/patches/m68k-picflag.diff
@@ -0,0 +1,15 @@
+# DP: backport of trunk r204854
+# DP: fixes relocation errors when linking large libs (smokeqt, python-qt4)
+
+--- a/src/config/picflag.m4
++++ b/src/config/picflag.m4
+@@ -48,9 +48,6 @@ case "${$2}" in
+ i[[34567]]86-*-* | x86_64-*-*)
+ $1=-fpic
+ ;;
+- m68k-*-*)
+- $1=-fpic
+- ;;
+ # FIXME: Override -fPIC default in libgcc only?
+ sh-*-linux* | sh[[2346lbe]]*-*-linux*)
+ $1=-fpic
only in patch2:
unchanged:
--- gcc-4.8-4.8.2.orig/debian/patches/pr52306.diff
+++ gcc-4.8-4.8.2/debian/patches/pr52306.diff
@@ -0,0 +1,15 @@
+# DP: Disable -fauto-inc-dec by default for m68k
+# DP: since it can generate ICEs in C++ code,
+# DP: until a fix is found.
+
+--- a/src/gcc/common.opt
++++ b/src/gcc/common.opt
+@@ -858,7 +858,7 @@ Common Report Var(flag_asynchronous_unwi
+ Generate unwind tables that are exact at each instruction boundary
+
+ fauto-inc-dec
+-Common Report Var(flag_auto_inc_dec) Init(1)
++Common Report Var(flag_auto_inc_dec) Init(0)
+ Generate auto-inc/dec instructions
+
+ ; -fcheck-bounds causes gcc to generate array bounds checks.
only in patch2:
unchanged:
--- gcc-4.8-4.8.2.orig/debian/patches/pr58369.diff
+++ gcc-4.8-4.8.2/debian/patches/pr58369.diff
@@ -0,0 +1,78 @@
+# DP: backport of trunk r204224
+# DP: fixes ICE during building boost 1.54
+# DP:
+# DP: PR rtl-optimization/58369
+# DP: * reload1.c (compute_reload_subreg_offset): New function.
+# DP: (choose_reload_regs): Use it to pass endian-correct
+# DP: offset to subreg_regno_offset.
+
+--- a/src/gcc/reload1.c
++++ b/src/gcc/reload1.c
+@@ -6362,6 +6362,37 @@ replaced_subreg (rtx x)
+ }
+ #endif
+
++/* Compute the offset to pass to subreg_regno_offset, for a pseudo of
++ mode OUTERMODE that is available in a hard reg of mode INNERMODE.
++ SUBREG is non-NULL if the pseudo is a subreg whose reg is a pseudo,
++ otherwise it is NULL. */
++
++static int
++compute_reload_subreg_offset (enum machine_mode outermode,
++ rtx subreg,
++ enum machine_mode innermode)
++{
++ int outer_offset;
++ enum machine_mode middlemode;
++
++ if (!subreg)
++ return subreg_lowpart_offset (outermode, innermode);
++
++ outer_offset = SUBREG_BYTE (subreg);
++ middlemode = GET_MODE (SUBREG_REG (subreg));
++
++ /* If SUBREG is paradoxical then return the normal lowpart offset
++ for OUTERMODE and INNERMODE. Our caller has already checked
++ that OUTERMODE fits in INNERMODE. */
++ if (outer_offset == 0
++ && GET_MODE_SIZE (outermode) > GET_MODE_SIZE (middlemode))
++ return subreg_lowpart_offset (outermode, innermode);
++
++ /* SUBREG is normal, but may not be lowpart; return OUTER_OFFSET
++ plus the normal lowpart offset for MIDDLEMODE and INNERMODE. */
++ return outer_offset + subreg_lowpart_offset (middlemode, innermode);
++}
++
+ /* Assign hard reg targets for the pseudo-registers we must reload
+ into hard regs for this insn.
+ Also output the instructions to copy them in and out of the hard regs.
+@@ -6499,6 +6530,7 @@ choose_reload_regs (struct insn_chain *c
+ int byte = 0;
+ int regno = -1;
+ enum machine_mode mode = VOIDmode;
++ rtx subreg = NULL_RTX;
+
+ if (rld[r].in == 0)
+ ;
+@@ -6519,7 +6551,10 @@ choose_reload_regs (struct insn_chain *c
+ if (regno < FIRST_PSEUDO_REGISTER)
+ regno = subreg_regno (rld[r].in_reg);
+ else
+- byte = SUBREG_BYTE (rld[r].in_reg);
++ {
++ subreg = rld[r].in_reg;
++ byte = SUBREG_BYTE (subreg);
++ }
+ mode = GET_MODE (rld[r].in_reg);
+ }
+ #ifdef AUTO_INC_DEC
+@@ -6557,6 +6592,9 @@ choose_reload_regs (struct insn_chain *c
+ rtx last_reg = reg_last_reload_reg[regno];
+
+ i = REGNO (last_reg);
++ byte = compute_reload_subreg_offset (mode,
++ subreg,
++ GET_MODE (last_reg));
+ i += subreg_regno_offset (i, GET_MODE (last_reg), byte, mode);
+ last_class = REGNO_REG_CLASS (i);
+