From patchwork Mon Feb 4 13:38:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 217927 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 3F2F72C02B0 for ; Tue, 5 Feb 2013 00:38: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=1360589921; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Date:Message-ID:Subject:From:To:Cc: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=tspqIw8 X/6Mp58mALPa4dmxR7fA=; b=Li5CQ+OytejhX5nsnddG8xtWDAX6ITyFr/49jnh +9ay8nTuosPdHL8ZynW/HdRfm3tdmN17zUYfdiTUQnM0rePCcZQwUZz2zWCmY8tJ rwwGP8qs884uTBRB2AiTKjhFx5ZeWotQtxBwxItXZmA21Bzi83ur5tgdni0ESrjF 8Fso= 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:MIME-Version:X-Received:Received:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=wa/+uILMBelsigalEVCOPk5jq4b0GZESzuw1q+aR5tjZFN4jW5R8HhWEQj3r5P JE37rQg9hxryBkcbRKmY7n6ASmmrbPaZ71YLXBf3FFis8gq4vsRvMeiPOlE7TtgJ n03JpmJe43OUtmwNmG/a4CGQhX5BHKzDZ63g8PceOQG3o=; Received: (qmail 21311 invoked by alias); 4 Feb 2013 13:38:31 -0000 Received: (qmail 21183 invoked by uid 22791); 4 Feb 2013 13:38:29 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_FN X-Spam-Check-By: sourceware.org Received: from mail-ie0-f178.google.com (HELO mail-ie0-f178.google.com) (209.85.223.178) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Feb 2013 13:38:23 +0000 Received: by mail-ie0-f178.google.com with SMTP id c13so5639838ieb.37 for ; Mon, 04 Feb 2013 05:38:23 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.50.46.228 with SMTP id y4mr6218277igm.40.1359985103289; Mon, 04 Feb 2013 05:38:23 -0800 (PST) Received: by 10.64.34.172 with HTTP; Mon, 4 Feb 2013 05:38:23 -0800 (PST) Date: Mon, 4 Feb 2013 14:38:23 +0100 Message-ID: Subject: [patch i386]: Fix PR target/56186 From: Kai Tietz To: GCC Patches Cc: Richard Henderson 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 Hello, this patch fixes reported regression about 128-bit return-type for x64 ABI. ChangeLog 2013-02-04 Kai Tietz PR target/56186 * i386.c (function_value_64): Add additional valtype argument and improve checking of return-argument types for 16-byte modes. (ix86_function_value_1): Add additional valtype argument on call of function_value_64. (return_in_memory_ms_64): Sync 16-byte sized mode handling with handling infunction_value_64 function. Tested for x86_64-w64-mingw32, and for x86_64-unknown-linux-gnu. Ok for apply? Regards, Kai Index: i386.c =================================================================== --- i386.c (Revision 195572) +++ i386.c (Arbeitskopie) @@ -7324,7 +7324,8 @@ function_value_64 (enum machine_mode orig_mode, en } static rtx -function_value_ms_64 (enum machine_mode orig_mode, enum machine_mode mode) +function_value_ms_64 (enum machine_mode orig_mode, enum machine_mode mode, + const_tree valtype) { unsigned int regno = AX_REG; @@ -7333,6 +7334,12 @@ static rtx switch (GET_MODE_SIZE (mode)) { case 16: + if (valtype != NULL_TREE + && !VECTOR_INTEGER_TYPE_P (valtype) + && !VECTOR_INTEGER_TYPE_P (valtype) + && !INTEGRAL_TYPE_P (valtype) + && !VECTOR_FLOAT_TYPE_P (valtype)) + break; if((SCALAR_INT_MODE_P (mode) || VECTOR_MODE_P (mode)) && !COMPLEX_MODE_P (mode)) regno = FIRST_SSE_REG; @@ -7361,7 +7368,7 @@ ix86_function_value_1 (const_tree valtype, const_t fntype = fn ? TREE_TYPE (fn) : fntype_or_decl; if (TARGET_64BIT && ix86_function_type_abi (fntype) == MS_ABI) - return function_value_ms_64 (orig_mode, mode); + return function_value_ms_64 (orig_mode, mode, valtype); else if (TARGET_64BIT) return function_value_64 (orig_mode, mode, valtype); else @@ -7474,7 +7481,9 @@ return_in_memory_ms_64 (const_tree type, enum mach HOST_WIDE_INT size = int_size_in_bytes (type); /* __m128 is returned in xmm0. */ - if ((SCALAR_INT_MODE_P (mode) || VECTOR_MODE_P (mode)) + if ((!type || VECTOR_INTEGER_TYPE_P (type) || INTEGRAL_TYPE_P (type) + || VECTOR_FLOAT_TYPE_P (type)) + && (SCALAR_INT_MODE_P (mode) || VECTOR_MODE_P (mode)) && !COMPLEX_MODE_P (mode) && (GET_MODE_SIZE (mode) == 16 || size == 16)) return false;