This is the mail archive of the
mailing list for the GCC project.
[PATCH] Possible fix for PR57717 (PowerPC E500v2)
- From: Julian Brown <julian at codesourcery dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: Alan Modra <amodra at gmail dot com>, Khem Raj <raj dot khem at gmail dot com>
- Date: Mon, 12 Aug 2013 14:58:04 +0100
- Subject: [PATCH] Possible fix for PR57717 (PowerPC E500v2)
At present, mainline fails to build a PowerPC E500v2 cross-compiler for
me because of the bug described in PR57717. The attached patch is a
possible fix for that, although I have been struggling to obtain good
evidence that it is correct due to lack of a working current baseline.
Without the patch, the partially-built compiler ICEs during a
cross-build trying to reload a TImode load instruction: I think this is
because the RTL generated by the clause modified by the attached patch
in rs6000_legitimize_reload_address is not valid for TARGET_E500_DOUBLE.
Simply disallowing all greater-than UNITS_PER_WORD-sized modes seems to
suffice to fix this.
I have tested on current mainline with the candidate patch in
http://gcc.gnu.org/bugzilla//show_bug.cgi?id=57717#c3 and compared the
results with my patch: this gives the same results. I configured with:
[...] --enable-e500_double --with-long-double-128 --with-cpu=8548
with a target of powerpc-linux-gnuspe (this is with our internal build
tools, which unfortunately I can't share), and tested on real hardware.0
(The last two options given are just working around build errors.) The
other test cases in PR57717 appear to work correctly with my patch too.
Unfortunately results show significant degradation relative to r189800
(before the patch identified in PR57717 was applied), though I believe
this to be due to a cause other than my patch (there seems to be some
kind of stack corruption in execute tests -- I've not yet tracked this
down). Also -- possibly related -- I had to add a hack to
rs6000_dwarf_register_span to get through the build, i.e.:
@@ -28940,6 +28940,9 @@ rs6000_dwarf_register_span (rtx reg)
unsigned regno = REGNO (reg);
enum machine_mode mode = GET_MODE (reg);
+ /* FIXME: This function causes an ICE when emitting Dwarf. */
+ return NULL_RTX;
&& regno < 32
&& (SPE_VECTOR_MODE (GET_MODE (reg))
I am not proposing that particular patch for committing, of course.
OK to commit, or any comments? If anyone's in a position to do some
further testing on the patch, I'd be grateful for that!
* config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Don't
perform invalid legitimization on greater-than-word-size modes for
--- gcc/config/rs6000/rs6000.c (revision 201609)
+++ gcc/config/rs6000/rs6000.c (working copy)
@@ -6930,9 +6930,7 @@ rs6000_legitimize_reload_address (rtx x,
&& GET_CODE (XEXP (x, 1)) == CONST_INT
&& !SPE_VECTOR_MODE (mode)
- && !(TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode
- || mode == DDmode || mode == TDmode
- || mode == DImode))
+ && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (mode) > UNITS_PER_WORD)
&& (!VECTOR_MODE_P (mode) || VECTOR_MEM_NONE_P (mode)))
HOST_WIDE_INT val = INTVAL (XEXP (x, 1));