From patchwork Mon Nov 1 18:10:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Koning X-Patchwork-Id: 69823 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 3B7571007D2 for ; Tue, 2 Nov 2010 05:10:44 +1100 (EST) Received: (qmail 3880 invoked by alias); 1 Nov 2010 18:10:40 -0000 Received: (qmail 3868 invoked by uid 22791); 1 Nov 2010 18:10:38 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, TW_FN, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ausxipps301.us.dell.com (HELO ausxipps301.us.dell.com) (143.166.148.223) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 01 Nov 2010 18:10:32 +0000 X-Loopcount0: from 10.152.240.141 From: Paul Koning Subject: [PATCH] pdp11: return vector mode results in memory Date: Mon, 1 Nov 2010 14:10:29 -0400 Message-Id: <5D320055-2D90-40C3-ACC2-4E1C8724661A@dell.com> To: gcc-patches Mime-Version: 1.0 (Apple Message framework v1081) 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 pdp11 back end was trying to return vector modes in a register, if the component type was of a mode that does this. But there aren't enough registers for that, resulting in ICE in a couple of test cases. This patch changes vectors (and complex) to be memory returns. Tested by build, make check. Committed. paul ChangeLog: 2010-11-01 Paul Koning * config/pdp11/pdp11.c (pdp11_return_in_memory): Return vector and complex modes in memory. Index: config/pdp11/pdp11.c =================================================================== --- config/pdp11/pdp11.c (revision 166133) +++ config/pdp11/pdp11.c (working copy) @@ -1816,14 +1816,12 @@ static bool pdp11_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) { - /* Should probably return DImode and DFmode in memory, lest - we fill up all regs! - - have to, else we crash - exception: maybe return result in - ac0 if DFmode and FPU present - compatibility problem with - libraries for non-floating point.... */ + /* Integers 32 bits and under, and scalar floats (if FPU), are returned + in registers. The rest go into memory. */ return (TYPE_MODE (type) == DImode - || (FLOAT_MODE_P (TYPE_MODE (type)) && ! TARGET_AC0)); + || (FLOAT_MODE_P (TYPE_MODE (type)) && ! TARGET_AC0) + || TREE_CODE (type) == VECTOR_TYPE + || COMPLEX_MODE_P (TYPE_MODE (type))); } /* Worker function for TARGET_FUNCTION_VALUE.