From patchwork Mon Mar 12 15:50:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tristan Gingold X-Patchwork-Id: 146139 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 2EB59B6FAA for ; Tue, 13 Mar 2012 02:50:51 +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=1332172253; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:Content-Type:Content-Transfer-Encoding:Subject: Date:Message-Id:To:Mime-Version:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=LlTdq+pWl9ZEjSNgBnoZpYVWjJg=; b=DWya5FB6VI90N/x BHLXyXN0JPP5mHL5YwDXIRXvrZoTjfRltMSgUhQEbDOqFFM3ZL0ptJTeJeXtBGdk REF/a0cds8eEvWokj109TuK+dbgETxVkke15PEars2GBwHko/mhwhF9oQyFDSL7s o7V3Z9NMXPEUZHrMOV8s0moVW6TY= 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:Received:From:Content-Type:Content-Transfer-Encoding:Subject:Date:Message-Id:To:Mime-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=stELSMLsnSNRcSVMob6uAo6dalHP5qf2k1Dz0jBaKFmQPhSTGSJv4OfX2QiSCi F8oVGk+Ah7lkC6WVO1Y8aPRPp0HMeCiFHAXsAiOdsiLpsS0cFO5C4gpJRmyO+9wN ZTNkSlE9fQtEkqSJmAoZHvWFU2OQPvsMEY2GLYYSaAV2M=; Received: (qmail 488 invoked by alias); 12 Mar 2012 15:50:39 -0000 Received: (qmail 455 invoked by uid 22791); 12 Mar 2012 15:50:37 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Mar 2012 15:50:24 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id B181129000A for ; Mon, 12 Mar 2012 16:50:24 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i-L7ZnX1vJ9W for ; Mon, 12 Mar 2012 16:50:24 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 9F00029000E for ; Mon, 12 Mar 2012 16:50:24 +0100 (CET) From: Tristan Gingold Subject: [VMS/committed]: Fix ABI issue on vms/ia64 Date: Mon, 12 Mar 2012 16:50:22 +0100 Message-Id: <7EA61803-EE49-4F04-B758-91FE56741AF4@adacore.com> To: GCC Patches Mime-Version: 1.0 (Apple Message framework v1257) 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 Hi, ia64/VMS doesn't closely follow the 'standard' ia64 ABI (in order to be backward compatible with VAX). We recently found one mismatch while passing FP parameters. Manually tested and checked - no test case added as this require another compiler to test. Committed on trunk. Tristan. 2012-03-12 Tristan Gingold * config/ia64/ia64.c (ia64_function_arg_1): Move code around. (ia64_function_arg_advance): Ditto. Index: gcc/config/ia64/ia64.c =================================================================== --- gcc/config/ia64/ia64.c (revision 185231) +++ gcc/config/ia64/ia64.c (working copy) @@ -4491,6 +4491,15 @@ if (cum->words + offset >= MAX_ARGUMENT_SLOTS) return 0; + /* On OpenVMS argument is either in Rn or Fn. */ + if (TARGET_ABI_OPEN_VMS) + { + if (FLOAT_MODE_P (mode)) + return gen_rtx_REG (mode, FR_ARG_FIRST + cum->words); + else + return gen_rtx_REG (mode, basereg + cum->words); + } + /* Check for and handle homogeneous FP aggregates. */ if (type) hfa_mode = hfa_element_mode (type, 0); @@ -4577,15 +4586,6 @@ return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc)); } - /* On OpenVMS variable argument is either in Rn or Fn. */ - else if (TARGET_ABI_OPEN_VMS && named == 0) - { - if (FLOAT_MODE_P (mode)) - return gen_rtx_REG (mode, FR_ARG_FIRST + cum->words); - else - return gen_rtx_REG (mode, basereg + cum->words); - } - /* Integral and aggregates go in general registers. If we have run out of FR registers, then FP values must also go in general registers. This can happen when we have a SFmode HFA. */ @@ -4736,6 +4736,14 @@ cum->atypes[cum->words] = ia64_arg_type (mode); cum->words += words + offset; + /* On OpenVMS argument is either in Rn or Fn. */ + if (TARGET_ABI_OPEN_VMS && named == 0) + { + cum->int_regs = cum->words; + cum->fp_regs = cum->words; + return; + } + /* Check for and handle homogeneous FP aggregates. */ if (type) hfa_mode = hfa_element_mode (type, 0); @@ -4776,13 +4784,6 @@ cum->fp_regs = fp_regs; } - /* On OpenVMS variable argument is either in Rn or Fn. */ - else if (TARGET_ABI_OPEN_VMS && named == 0) - { - cum->int_regs = cum->words; - cum->fp_regs = cum->words; - } - /* Integral and aggregates go in general registers. So do TFmode FP values. If we have run out of FR registers, then other FP values must also go in general registers. This can happen when we have a SFmode HFA. */