From patchwork Mon Aug 12 13:58:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 266546 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id AEC7E2C00F4 for ; Mon, 12 Aug 2013 23:58:21 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=jnCAWBLwjGv2gld3fEyK32A+BQl8DvkwPfcoAR1bi13uyIojgL kF5paB2N5MhoP674p4ja40ufsZMxuoRbj/I6kd88Zv9oGLfDtskuUqGJcGkP/bG9 CBpi6kIpZNI5amdQBfWel0/9Va59ANCNnAVdde/ByxTOEVIyulWm3ar0Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=qQnLLsIPPUIpthZTFGnRyCHrpmo=; b=Ipsc+ESb/LFdsZ7Ac/55 MdFGsYCnskaee9GWhduppoeNHT2X75M/+Y5+p+hd6oWsSPXOia8IDlSt2oyuB+mc jEHM7hfSDHGESqG4NB4TcXvNC9S1wTM47rgNEQg/nLfCPlJtOKjbAqV55mtxXj0u HoBdapQtt3WricMxpIO/heg= Received: (qmail 21940 invoked by alias); 12 Aug 2013 13:58:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 21929 invoked by uid 89); 12 Aug 2013 13:58:15 -0000 X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL, BAYES_00, FROM_12LTRDOM, KHOP_RCVD_UNTRUST, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL autolearn=no version=3.3.2 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 12 Aug 2013 13:58:14 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1V8sdQ-0004zK-Vv from Julian_Brown@mentor.com ; Mon, 12 Aug 2013 06:58:13 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 12 Aug 2013 06:58:13 -0700 Received: from octopus (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Mon, 12 Aug 2013 14:58:11 +0100 Date: Mon, 12 Aug 2013 14:58:04 +0100 From: Julian Brown To: CC: Alan Modra , Khem Raj Subject: [PATCH] Possible fix for PR57717 (PowerPC E500v2) Message-ID: <20130812145804.2eb1a65d@octopus> MIME-Version: 1.0 X-Virus-Found: No Hi, 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 --disable-decimal-float --disable-libvtv 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; + if (TARGET_SPE && 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! Thanks, Julian ChangeLog gcc/ * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Don't perform invalid legitimization on greater-than-word-size modes for TARGET_E500_DOUBLE. Index: gcc/config/rs6000/rs6000.c =================================================================== --- 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 && reg_offset_p && !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));