From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25083 invoked by alias); 10 Nov 2015 00:49:39 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 25002 invoked by uid 89); 10 Nov 2015 00:49:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 10 Nov 2015 00:49:38 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 3075D33057E4 for ; Tue, 10 Nov 2015 01:49:35 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f4QXMn2PdlmF for ; Tue, 10 Nov 2015 01:49:35 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 0C56333057D9 for ; Tue, 10 Nov 2015 01:49:35 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [SPARC] Fix PR target/57845 Date: Tue, 10 Nov 2015 00:49:00 -0000 Message-ID: <3023197.FrU39L0Kvz@polaris> User-Agent: KMail/4.14.9 (Linux/3.16.7-29-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart5283524.nal6O4Ee0G" Content-Transfer-Encoding: 7Bit X-SW-Source: 2015-11/txt/msg01145.txt.bz2 This is a multi-part message in MIME format. --nextPart5283524.nal6O4Ee0G Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Content-length: 694 This PR is about an ICE on SPARC 32-bit with -freg-struct-return. I didn't know that this option was supported on this architecture but apparently it was, at least in the 3.x series, so the attached patchlet fixes the ICE. Tested on SPARC/Solaris (including compat testing), applied on all branches. 2015-11-09 Eric Botcazou PR target/57845 * config/sparc/sparc.c (sparc_function_value_1): In 32-bit mode, do not promote the mode for aggregate types. 2015-11-09 Eric Botcazou * gcc.target/sparc/sparc-ret.c: Rename to... * gcc.target/sparc/sparc-ret-1.c: ...this. * gcc.target/sparc/sparc-ret-2.c: New test. -- Eric Botcazou --nextPart5283524.nal6O4Ee0G Content-Disposition: attachment; filename="pr57845.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="pr57845.diff" Content-length: 717 Index: config/sparc/sparc.c =================================================================== --- config/sparc/sparc.c (revision 230016) +++ config/sparc/sparc.c (working copy) @@ -7329,9 +7329,10 @@ sparc_function_value_1 (const_tree type, mode = word_mode; } - /* We should only have pointer and integer types at this point. This must - match sparc_promote_function_mode. */ + /* We should only have pointer and integer types at this point, except with + -freg-struct-return. This must match sparc_promote_function_mode. */ else if (TARGET_ARCH32 + && !(type && AGGREGATE_TYPE_P (type)) && mclass == MODE_INT && GET_MODE_SIZE (mode) < UNITS_PER_WORD) mode = word_mode; --nextPart5283524.nal6O4Ee0G Content-Disposition: attachment; filename="sparc-ret-2.c" Content-Transfer-Encoding: 7Bit Content-Type: text/x-csrc; charset="UTF-8"; name="sparc-ret-2.c" Content-length: 187 /* PR target/57845 */ /* { dg-do compile } */ /* { dg-options "-freg-struct-return" } */ struct S { short int i; }; struct S foo (short int i) { struct S s; s.i = i; return s; } --nextPart5283524.nal6O4Ee0G--