From patchwork Tue Jul 14 17:15:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 1329010 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=kCfg8rBF; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B5nFt4P8Pz9sQt for ; Wed, 15 Jul 2020 03:15:13 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E35E03865460; Tue, 14 Jul 2020 17:15:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E35E03865460 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594746910; bh=KerNbHetIUDEaTV+FtRcbr+lOUYxBVv1PL1lRLb3PFY=; h=Subject:To:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=kCfg8rBFoj+MQ0k6Bh0B0zXMF3VV7mezV+mm36KU1w8mGPveCVAEP7NhREabGLmqf MK7Gh1WY8w/S1q3z1A2pZCk5ECcF/NPhmI9gQQH0WB4XHpM8zTFvQvfBq9g3RDu2NJ d7cb/nyYYbAMqaalqAn8btS756sO2HXSjMqHMIWQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 3EED8385BF81 for ; Tue, 14 Jul 2020 17:15:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3EED8385BF81 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06EH5CYX170391; Tue, 14 Jul 2020 13:15:07 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3277k9nk5t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Jul 2020 13:15:06 -0400 Received: from m0098413.ppops.net (m0098413.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 06EHF6Yq017109; Tue, 14 Jul 2020 13:15:06 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0b-001b2d01.pphosted.com with ESMTP id 3277k9nk5f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Jul 2020 13:15:06 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06EH9TBU015206; Tue, 14 Jul 2020 17:15:05 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma04dal.us.ibm.com with ESMTP id 3275298h2v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Jul 2020 17:15:05 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06EHF4qD64094580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Jul 2020 17:15:04 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 17A06780DA; Tue, 14 Jul 2020 17:15:04 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CCC57780E0; Tue, 14 Jul 2020 17:15:02 +0000 (GMT) Received: from sig-9-65-252-120.ibm.com (unknown [9.65.252.120]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 14 Jul 2020 17:15:02 +0000 (GMT) Message-ID: Subject: [PATCH, rs6000, gcc-8 ] Improve handling of built-in initialization. [PR95952] To: GCC Patches Date: Tue, 14 Jul 2020 12:15:01 -0500 X-Mailer: Evolution 3.28.5 (3.28.5-8.el7) Mime-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-14_06:2020-07-14, 2020-07-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=3 phishscore=0 spamscore=0 adultscore=0 mlxscore=0 impostorscore=0 mlxlogscore=473 bulkscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007140125 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: will schmidt via Gcc-patches From: will schmidt Reply-To: will schmidt Cc: Peter Bergner , David Edelsohn , Segher Boessenkool , mikpelinux@gmail.com Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, We've got a scenario with a combination of old hardware, gcc-8 and binutils where gcc will ICE during it's selftest. This ICE was exposed when the builtin processing for better #pragma support was added, where we no longer skip builtin initialization based on the current mask. Per the bug report and assorted debug, the ICE occurrs when building the gcc-8 branch on a 970* based system with an old binutils. (gcc-9 and newer is OK. binutils 2.34 is reported to allow success). The attached patch adds a clause to the builtin initialization to skip initialization of a builtin when the builtin mask is set but the icode value is zero. The subsequent assert check remains in place. I've successfully tested this on a yellowdog (970mp) based system. Mikael has confirmed this allows success on his system. OK for gcc-8 ? Thanks, -Will 2020-07-13 Will Schmidt gcc/ChangeLog: PR target/95952 * gcc/config/rs6000.c (altivec_init_builtins): Add continue clause to predicate builtin handling. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 75d40367a98..18713599d3b 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -18015,10 +18015,24 @@ altivec_init_builtins (void) if (rs6000_overloaded_builtin_p (d->code)) mode1 = VOIDmode; else { + /* PR95952: Gracefully skip builtins that do not have the icode properly + set, but do have the builtin mask set. This has occurred in older gcc + builds with older binutils support when binutils refuses code generation + for instructions that it does not support. This was exposed by changes + allowing all builtins being initialized for better #pragma support. */ + if (d->icode == CODE_FOR_nothing && d->mask) { + HOST_WIDE_INT builtin_mask = rs6000_builtin_mask; + if (TARGET_DEBUG_BUILTIN) { + fprintf (stderr, "altivec_init_builtins, altivec predicate builtin %s", d->name); + fprintf (stderr, " was skipped. icode:%d, mask: %lx, builtin_mask: 0x%lx", + d->icode, d->mask, builtin_mask); + } + continue; + } /* Cannot define builtin if the instruction is disabled. */ gcc_assert (d->icode != CODE_FOR_nothing); mode1 = insn_data[d->icode].operand[1].mode; }