From patchwork Sat Dec 1 03:01:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 203095 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]) by ozlabs.org (Postfix) with SMTP id 284752C008E for ; Sat, 1 Dec 2012 14:01:44 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1354935705; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Date:From:To:Subject:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=FxGXT7R XCtAUDBd4fos8vUms/Ew=; b=NmNBgOiXCHa9tMQJvzpSRH677/z3nKu/YIHT+uV It2GigaLzXaOgOJREWUl/5vFGazwhJmDt998dp+lJEHLpfL+QgtXCalKrbgYnBtu IBu6A/9tyDYuJxZoFSxREH1oXIee98e2kfivq3nx0STDf6cbzHWreqE41oFBqOBG Li78= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Date:From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=ZJaeErRitrZMm7jQutvNAvMWJtUPgpnAFd+V9fNRYxECitHd4CbbSPulx4CEjE fXXcV5FRqpSTDpyqyrGkqNrMF91L+h2uAK7fvSLaKl6y7q0K/eIrFpgwwClGTT7J D3gUgrf+dwPIskdeXzo7yr4ZQ5+HCsQPAsR3/vXx4kms0=; Received: (qmail 24872 invoked by alias); 1 Dec 2012 03:01:32 -0000 Received: (qmail 24862 invoked by uid 22791); 1 Dec 2012 03:01:30 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from dair.pair.com (HELO dair.pair.com) (209.68.1.49) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Sat, 01 Dec 2012 03:01:23 +0000 Received: (qmail 84148 invoked by uid 20157); 1 Dec 2012 03:01:22 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 1 Dec 2012 03:01:22 -0000 Date: Fri, 30 Nov 2012 22:01:22 -0500 (EST) From: Hans-Peter Nilsson To: gcc-patches@gcc.gnu.org Subject: [RFA:] fix group-loads of VOIDmode constants, expr.c:emit_group_load_1 Message-ID: User-Agent: Alpine 2.02 (BSF 1266 2009-07-14) MIME-Version: 1.0 X-IsSubscribed: yes 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 (No cans of worms opened here, I believe...) For MMIX with the default, Knuth's ABI (returning values in register $0, through the register stack), function return values are prepared in a register-swapped fashion due to the way the register stack works, which has to be expressed as: (parallel [ (expr_list:REG_DEP_TRUE (reg:DI 0 $0) (const_int 8 [0x8])) (expr_list:REG_DEP_TRUE (reg:DI 1 $1) (const_int 0 [0])) ]) i.e. a group load. Compare to the more intuitive "GNU ABI", passing parameters straightforwardly, with the order in the called and the calling function being the same, starting with global register $231. Of course this matters only to >64bit (i.e. >registersize) values like TImode, alias __int128. The problem here is that group-loading a constant for a function return-value doesn't work; it's passed to simplify_gen_subreg which horks on the VOIDmode constant. Thankfully, the code below the context handles this case, twice the register-mode, just fine, so let's just gate the simplify_gen_subreg call with a test for a VOIDmode source. Bootstrapped and checked for x86_64-*-linux-gnu and checked for mmix-knuth-mmixware, both -mabi=gnu multilib (no regressions) and the base multilib with the Knuth ABI, where the patch below fixes: Running /home/hp/gcctop/tmp/mbasf/gcc/gcc/testsuite/gcc.c-torture/execute/execute.exp ... ... FAIL: gcc.c-torture/execute/pr54471.c compilation, -O1 (internal compiler error) FAIL: gcc.c-torture/execute/pr54471.c compilation, -O2 (internal compiler error) FAIL: gcc.c-torture/execute/pr54471.c compilation, -O3 -fomit-frame-pointer (internal compiler error) FAIL: gcc.c-torture/execute/pr54471.c compilation, -O3 -fomit-frame-pointer -funroll-loops (internal compiler error) FAIL: gcc.c-torture/execute/pr54471.c compilation, -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions (internal compiler error) FAIL: gcc.c-torture/execute/pr54471.c compilation, -O3 -g (internal compiler error) FAIL: gcc.c-torture/execute/pr54471.c compilation, -Os (internal compiler error) FAIL: gcc.c-torture/execute/pr54471.c compilation, -O2 -flto -fno-use-linker-plugin -flto-partition=none (internal compiler error) FAIL: gcc.c-torture/execute/pr54471.c compilation, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects (internal compiler error) ... Running /home/hp/gcctop/tmp/mbasf/gcc/gcc/testsuite/gcc.dg/dg.exp ... ... FAIL: gcc.dg/pr32912-2.c (internal compiler error) FAIL: gcc.dg/pr32912-2.c (test for excess errors) FAIL: gcc.dg/pr32912-3.c (internal compiler error) FAIL: gcc.dg/pr32912-3.c (test for excess errors) ... Running /home/hp/gcctop/tmp/mbasf/gcc/gcc/testsuite/gcc.dg/torture/dg-torture.exp ... ... FAIL: c-c++-common/torture/vector-compare-2.c -O1 (internal compiler error) FAIL: c-c++-common/torture/vector-compare-2.c -O1 (test for excess errors) FAIL: c-c++-common/torture/vector-compare-2.c -O2 (internal compiler error) FAIL: c-c++-common/torture/vector-compare-2.c -O2 (test for excess errors) FAIL: c-c++-common/torture/vector-compare-2.c -O3 -fomit-frame-pointer (internal compiler error) FAIL: c-c++-common/torture/vector-compare-2.c -O3 -fomit-frame-pointer (test for excess errors) FAIL: c-c++-common/torture/vector-compare-2.c -O3 -fomit-frame-pointer -funroll-loops (internal compiler error) FAIL: c-c++-common/torture/vector-compare-2.c -O3 -fomit-frame-pointer -funroll-loops (test for excess errors) FAIL: c-c++-common/torture/vector-compare-2.c -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions (internal compiler error) FAIL: c-c++-common/torture/vector-compare-2.c -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions (test for excess errors) FAIL: c-c++-common/torture/vector-compare-2.c -O3 -g (internal compiler error) FAIL: c-c++-common/torture/vector-compare-2.c -O3 -g (test for excess errors) FAIL: c-c++-common/torture/vector-compare-2.c -Os (internal compiler error) FAIL: c-c++-common/torture/vector-compare-2.c -Os (test for excess errors) FAIL: c-c++-common/torture/vector-compare-2.c -O2 -flto -fno-use-linker-plugin -flto-partition=none (internal compiler error) FAIL: c-c++-common/torture/vector-compare-2.c -O2 -flto -fno-use-linker-plugin -flto-partition=none (test for excess errors) (ditto the c++ testsuite for c-c++-common/torture/vector-compare-2.c) (FWIW, the failing gcc.dg/pr32912-3.c is a regression.) Ok? gcc: * expr.c (emit_group_load_1): Don't call simplify_gen_subreg for a VOIDmode src. brgds, H-P Index: gcc/expr.c =================================================================== --- gcc/expr.c (revision 192677) +++ gcc/expr.c (working copy) @@ -1739,7 +1739,9 @@ emit_group_load_1 (rtx *tmps, rtx dst, r emit_move_insn (mem, src); tmps[i] = adjust_address (mem, mode, (int) bytepos); } - else if (CONSTANT_P (src) && GET_MODE (dst) != BLKmode + else if (CONSTANT_P (src) + && GET_MODE (src) != VOIDmode + && GET_MODE (dst) != BLKmode && XVECLEN (dst, 0) > 1) tmps[i] = simplify_gen_subreg (mode, src, GET_MODE(dst), bytepos); else if (CONSTANT_P (src))