From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44957 invoked by alias); 28 Nov 2018 21:27:29 -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 44837 invoked by uid 89); 28 Nov 2018 21:27:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.3 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,KAM_NUMSUBJECT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Nov 2018 21:27:24 +0000 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wASLIgLD013184 for ; Wed, 28 Nov 2018 16:27:23 -0500 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0b-001b2d01.pphosted.com with ESMTP id 2p22sggcsd-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 28 Nov 2018 16:27:23 -0500 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 28 Nov 2018 21:27:22 -0000 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 28 Nov 2018 21:27:20 -0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wASLRK6f16580628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 28 Nov 2018 21:27:20 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E7EBEAC059; Wed, 28 Nov 2018 21:27:19 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B8D9AC064; Wed, 28 Nov 2018 21:27:19 +0000 (GMT) Received: from otta.local (unknown [9.85.179.85]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 28 Nov 2018 21:27:19 +0000 (GMT) From: Peter Bergner Subject: [PATCH, rs6000] Fix PR87496: ICE in aggregate_value_p at gcc/function.c:2046 To: Segher Boessenkool Cc: GCC Patches , Michael Meissner Date: Wed, 28 Nov 2018 21:27:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit x-cbid: 18112821-0072-0000-0000-000003D0C467 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010138; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000270; SDB=6.01124145; UDB=6.00582089; IPR=6.00904275; MB=3.00024373; MTD=3.00000008; XFM=3.00000015; UTC=2018-11-28 21:27:22 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18112821-0073-0000-0000-00004A435068 Message-Id: X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg02367.txt.bz2 PR87496 shows a bug where we ICE if we attempt to use -mabi=ieeelongdouble and -mno-popcntd. The IEEE128 support requires full ISA 2.06 (aka POWER7) support, so we really should throw an error when using those options together. Ditto for -mabi=ieeelongdouble and -mno-vsx. The patch below does that. Ok for mainline once bootstrap and regtesting are complete and clean? Peter gcc/ PR target/87496 * config/rs6000/rs6000.c (rs6000_option_override_internal): Disallow -mabi=ieeelongdouble without both -mpopcntd and -mvsx. gcc/testsuite/ PR target/87496 * gcc.target/powerpc/pr87496.c: New test. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 266566) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -4291,16 +4291,22 @@ rs6000_option_override_internal (bool gl if (!global_options_set.x_rs6000_ieeequad) rs6000_ieeequad = TARGET_IEEEQUAD_DEFAULT; - else if (rs6000_ieeequad != TARGET_IEEEQUAD_DEFAULT && TARGET_LONG_DOUBLE_128) + else { - static bool warned_change_long_double; - if (!warned_change_long_double) + if (!TARGET_POPCNTD || !TARGET_VSX) + error ("%qs requires full ISA 2.06 support", "-mabi=ieeelongdouble"); + + if (rs6000_ieeequad != TARGET_IEEEQUAD_DEFAULT && TARGET_LONG_DOUBLE_128) { - warned_change_long_double = true; - if (TARGET_IEEEQUAD) - warning (OPT_Wpsabi, "Using IEEE extended precision long double"); - else - warning (OPT_Wpsabi, "Using IBM extended precision long double"); + static bool warned_change_long_double; + if (!warned_change_long_double) + { + warned_change_long_double = true; + if (TARGET_IEEEQUAD) + warning (OPT_Wpsabi, "Using IEEE extended precision long double"); + else + warning (OPT_Wpsabi, "Using IBM extended precision long double"); + } } } Index: gcc/testsuite/gcc.target/powerpc/pr87496.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/pr87496.c (nonexistent) +++ gcc/testsuite/gcc.target/powerpc/pr87496.c (working copy) @@ -0,0 +1,10 @@ +/* PR target/87496.c */ +/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */ +/* { dg-require-effective-target longdouble128 } */ +/* { dg-options "-O2 -mcpu=power7 -mabi=ieeelongdouble -mno-popcntd -Wno-psabi" } */ + +int i; + +/* { dg-error "'-mabi=ieeelongdouble' requires full ISA 2.06 support" "PR87496" { target *-*-* } 0 } */