From patchwork Tue Nov 19 15:03:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Weigand X-Patchwork-Id: 292470 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DC5622C009C for ; Wed, 20 Nov 2013 02:05:33 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:to:date:from:cc:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=GBoujbOowr3uf00N d7tQ/uBxg4NjAbsdVreqLYUzTCfORoJvjRZWREefUO+zD2g55O7Jy+FooWABGjYQ aX/VuN2PTn1KvGi0BUhjo8oylf9hJsNcN4hN0x84sd8L6dx1AaolOo6nF9vP+2km xpuHZ21mLYnKPnPsHVO7B+TR3So= 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 :message-id:subject:to:date:from:cc:mime-version:content-type :content-transfer-encoding; s=default; bh=4zcGh32Ud7ekBSmIphQcc9 /wm9w=; b=NkP7BlQzAMdJzgVG29ffrCk0caMmuMXioB5yAswixniE8HTy8kTFy3 3QtqQxQvPgQHiYb4WDlcN+Y0CzdUQit6GztgSQB9+IC3MlNBxcrhJ4XKnIdJdNGn CcmHV1TdsmlId3zCLUb18JLJI0A9FEberiF4gNF05nC3AXGcyFfK0= Received: (qmail 11645 invoked by alias); 19 Nov 2013 15:05:20 -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 11630 invoked by uid 89); 19 Nov 2013 15:05:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=AWL, BAYES_50, MSGID_FROM_MTA_HEADER, RDNS_NONE, SPF_PASS, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: e06smtp15.uk.ibm.com Received: from Unknown (HELO e06smtp15.uk.ibm.com) (195.75.94.111) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 19 Nov 2013 15:05:18 +0000 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 19 Nov 2013 15:05:08 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 19 Nov 2013 15:05:07 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 76C3A219005C for ; Tue, 19 Nov 2013 15:05:06 +0000 (GMT) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps3075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rAJF3cCg57999366 for ; Tue, 19 Nov 2013 15:03:38 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rAJF3o9X024304 for ; Tue, 19 Nov 2013 08:03:50 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id rAJF3lX3024031; Tue, 19 Nov 2013 08:03:47 -0700 Message-Id: <201311191503.rAJF3lX3024031@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 19 Nov 2013 16:03:46 +0100 Subject: [PATCH, rs6000] Fix ICE when loading vectors into GPRs in little-endian To: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com Date: Tue, 19 Nov 2013 16:03:46 +0100 (CET) From: "Ulrich Weigand" Cc: wschmidt@linux.vnet.ibm.com MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13111915-0342-0000-0000-000006E93F60 Hello, running the testsuite in powerpc64le-linux with --with-cpu=power7 causes FAIL: tmpdir-g++.dg-struct-layout-1/t024 cp_compat_x_tst.o compile, (internal compiler error) due to an unrecognizable insn (insn 137 136 138 5 (set (reg:V2DI 5 5) (vec_select:V2DI (reg:V2DI 211) (parallel [ (const_int 1 [0x1]) (const_int 0 [0]) ]))) /home/gcc-build/gcc/testsuite/g++/g++.dg-struct-layout-1//t024_test.h:6 -1 (nil)) i.e. an attempted vector permute into a GPR hard reg. It turns out this happens when rs6000_emit_le_vsx_move is called with a GPR hard reg destination, which in turn can happen when passing vectors to a vararg routine. However, rs6000_emit_le_vsx_move is not set up to handle GPRs. Fortunately, for GPRs this routine is not actually necessary; vectors can be loaded into GPRs using the regular move patterns. This patch fixes the problem by not invoking the rs6000_emit_le_vsx_move special case if a hard reg GPR is involved as source/destination. Tested on powerpc64le-linux. OK for mainline? Bye, Ulrich ChangeLog: * config/rs6000/vector.md ("mov"): Do not call rs6000_emit_le_vsx_move to move into or out of GPRs. * config/rs6000/rs6000.c (rs6000_emit_le_vsx_move): Assert source and destination are not GPR hard regs. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 205009) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -7947,6 +7947,7 @@ gcc_assert (!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (mode) && mode != TImode + && !gpr_or_gpr_p (dest, source) && (MEM_P (source) ^ MEM_P (dest))); if (MEM_P (source)) Index: gcc/config/rs6000/vector.md =================================================================== --- gcc/config/rs6000/vector.md (revision 205009) +++ gcc/config/rs6000/vector.md (working copy) @@ -108,6 +108,7 @@ if (!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (mode) && mode != TImode + && !gpr_or_gpr_p (operands[0], operands[1]) && (memory_operand (operands[0], mode) ^ memory_operand (operands[1], mode))) {