From patchwork Sun Oct 14 21:01:30 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: 191423 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 D0E0D2C0082 for ; Mon, 15 Oct 2012 08:01:40 +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=1350853301; 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=Tk+meQd N2hXNo76+HJYGCFyIpVs=; b=QHEKO3wYrqm5RjDs6Q5Aqiz2RaS9uGbJ+Vwi/pI Tb9LNvJ3MKIJ3SNlE390LBVxHuQKW+JVZxy1MWtBZV2qUt98MRVeGaK2ibMmwYso aCQyhfWN8hM3jDb/064AG0ttonvZ6q2QJt1KSVIuLlfkS94PRfObEYA3SnyDuUK+ O0I8= 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=kj1BRDyLNPnYfLBh8A0Zwp5dStbbsfLRM+C948huhNYkrbAP9Jecp0QQg0LJ8M x9Qx76OkPGqNgmbh//T69dB3M/qlTvf4Vwo7E2TA1xbdbpao6a+/n8mnHizKWSJs u4a6n7cnEl88zm8sZ9GVZSDET1LP3XtE1Beqh6Sej1xUk=; Received: (qmail 18904 invoked by alias); 14 Oct 2012 21:01:37 -0000 Received: (qmail 18896 invoked by uid 22791); 14 Oct 2012 21:01:37 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_20 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; Sun, 14 Oct 2012 21:01:31 +0000 Received: (qmail 45687 invoked by uid 20157); 14 Oct 2012 21:01:30 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 14 Oct 2012 21:01:30 -0000 Date: Sun, 14 Oct 2012 17:01:30 -0400 (EDT) From: Hans-Peter Nilsson To: gcc-patches@gcc.gnu.org Subject: Committed, MMIX: fix INCOMING_REGNO / OUTGOING_REGNO for return-value Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) 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 Back then, I must've missed that INCOMING_REGNO / OUTGOING_REGNO are used to map return-value-register/s too. Fixes: FAIL: gcc.dg/builtin-apply4.c execution test ... FAIL: gcc.dg/builtin-return-1.c execution test ... FAIL: gcc.dg/torture/stackalign/builtin-apply-4.c -O0 execution test FAIL: gcc.dg/torture/stackalign/builtin-apply-4.c -O1 execution test FAIL: gcc.dg/torture/stackalign/builtin-apply-4.c -O2 execution test FAIL: gcc.dg/torture/stackalign/builtin-apply-4.c -O3 -fomit-frame-pointer execution test FAIL: gcc.dg/torture/stackalign/builtin-apply-4.c -O3 -g execution test FAIL: gcc.dg/torture/stackalign/builtin-apply-4.c -Os execution test FAIL: gcc.dg/torture/stackalign/builtin-apply-4.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution tes\ t FAIL: gcc.dg/torture/stackalign/builtin-apply-4.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test FAIL: gcc.dg/torture/stackalign/builtin-return-1.c -O0 execution test FAIL: gcc.dg/torture/stackalign/builtin-return-1.c -O1 execution test FAIL: gcc.dg/torture/stackalign/builtin-return-1.c -O2 execution test FAIL: gcc.dg/torture/stackalign/builtin-return-1.c -O3 -fomit-frame-pointer execution test FAIL: gcc.dg/torture/stackalign/builtin-return-1.c -O3 -g execution test FAIL: gcc.dg/torture/stackalign/builtin-return-1.c -Os execution test FAIL: gcc.dg/torture/stackalign/builtin-return-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution te\ st FAIL: gcc.dg/torture/stackalign/builtin-return-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test Committed. * config/mmix/mmix.c (mmix_opposite_regno): Handle the return-value register too. brgds, H-P --- gcc/config/mmix/mmix.c.prev 2012-10-09 02:00:51.000000000 +0200 +++ gcc/config/mmix/mmix.c 2012-10-14 00:59:54.000000000 +0200 @@ -392,15 +392,33 @@ mmix_conditional_register_usage (void) /* INCOMING_REGNO and OUTGOING_REGNO worker function. Those two macros must only be applied to function argument - registers. FIXME: for their current use in gcc, it'd be better - with an explicit specific additional FUNCTION_INCOMING_ARG_REGNO_P - a'la TARGET_FUNCTION_ARG / TARGET_FUNCTION_INCOMING_ARG instead of + registers and the function return value register for the opposite + use. FIXME: for their current use in gcc, it'd be better with an + explicit specific additional FUNCTION_INCOMING_ARG_REGNO_P a'la + TARGET_FUNCTION_ARG / TARGET_FUNCTION_INCOMING_ARG instead of forcing the target to commit to a fixed mapping and for any - unspecified register use. */ + unspecified register use. Particularly when thinking about the + return-value, it is better to imagine INCOMING_REGNO and + OUTGOING_REGNO as named CALLEE_TO_CALLER_REGNO and INNER_REGNO as + named CALLER_TO_CALLEE_REGNO because the direction. The "incoming" + and "outgoing" is from the perspective of the parameter-registers, + but the same macro is (must be, lacking an alternative like + suggested above) used to map the return-value-register from the + same perspective. To make directions even more confusing, the macro + MMIX_OUTGOING_RETURN_VALUE_REGNUM holds the number of the register + in which to return a value, i.e. INCOMING_REGNO for the return-value- + register as received from a called function; the return-value on the + way out. */ int mmix_opposite_regno (int regno, int incoming) { + if (incoming && regno == MMIX_OUTGOING_RETURN_VALUE_REGNUM) + return MMIX_RETURN_VALUE_REGNUM; + + if (!incoming && regno == MMIX_RETURN_VALUE_REGNUM) + return MMIX_OUTGOING_RETURN_VALUE_REGNUM; + if (!mmix_function_arg_regno_p (regno, incoming)) return regno;