From patchwork Tue Nov 5 11:33:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Malcomson X-Patchwork-Id: 1189597 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=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-512430-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="HqSbtBeh"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="M1voKRaR"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="M1voKRaR"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 476ncj2yqJz9sNT for ; Tue, 5 Nov 2019 22:34:13 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:references:in-reply-to :content-type:mime-version; q=dns; s=default; b=DTQoZ3r7QLWaZlyu D5M3wOfymxyNAJcgrP6xEEhBhiWuTvFCTdSp2W5w2wHsrX3vNOsSUDSFfnM09grf t82fP3Zo4UZx4uJKkwEIt+TQpKLrVUJ4P2xuwyOEU0YF7HbkSvin1XeUnMbzgT3q fDl7YQRSEROGSG/OzhglvemV7gk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:references:in-reply-to :content-type:mime-version; s=default; bh=l3nw8evDgSmd1ajWvV6wKh dZvuY=; b=HqSbtBehWlmIAf09Bgy3//ezkgYyLKb8ZgVc6rrIecufHUEzB4s5vz qJTpQhVRmnL9KTdOyqOBcKvzXw/D5BPbWdb+MiZB8QTLQl/TAFLmS9ttGYNJFvYA h4D95uRrrnpyRm0nXCwRlsUDso7yRfzyW7arKzj95RUp5HertKrbE= Received: (qmail 82559 invoked by alias); 5 Nov 2019 11:34:05 -0000 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 Received: (qmail 82549 invoked by uid 89); 5 Nov 2019 11:34:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=H*MI:sk:1572951, H*i:sk:1572951, H*f:sk:1572951 X-HELO: EUR01-DB5-obe.outbound.protection.outlook.com Received: from mail-eopbgr150072.outbound.protection.outlook.com (HELO EUR01-DB5-obe.outbound.protection.outlook.com) (40.107.15.72) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 05 Nov 2019 11:34:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AmhZ769QUM4ka5XRV8owCLuqflejCuCsWW24F1VtZw8=; b=M1voKRaR7h5vJMd9gMU1odiD87UyhjFY4PRje6587imIgD9/UgR5buPb6NzL5mJJxvbhWJ3knYpL3D3WOjMjyaCyHCjdF8Mc9LekziCGg9BrhC5CYI4OlYJ9904zRwJyNJpUp6g7uCliEf4SwzGwmt5HfWLUKzG8K4rLnvSQfsw= Received: from VI1PR08CA0241.eurprd08.prod.outlook.com (2603:10a6:803:dc::14) by DB8PR08MB5499.eurprd08.prod.outlook.com (2603:10a6:10:fa::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.24; Tue, 5 Nov 2019 11:34:00 +0000 Received: from AM5EUR03FT026.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::208) by VI1PR08CA0241.outlook.office365.com (2603:10a6:803:dc::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.20 via Frontend Transport; Tue, 5 Nov 2019 11:33:59 +0000 Authentication-Results: spf=fail (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; gcc.gnu.org; dmarc=none action=none header.from=arm.com; Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT026.mail.protection.outlook.com (10.152.16.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.20 via Frontend Transport; Tue, 5 Nov 2019 11:33:59 +0000 Received: ("Tessian outbound 0939a6bab6b1:v33"); Tue, 05 Nov 2019 11:33:59 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 047f0d069836d25a X-CR-MTA-TID: 64aa7808 Received: from 80b6a97b4ac6.2 (cr-mta-lb-1.cr-mta-net [104.47.14.51]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id EF1F976B-3C1C-4CDF-9784-DABE41EEBF78.1; Tue, 05 Nov 2019 11:33:54 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2051.outbound.protection.outlook.com [104.47.14.51]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 80b6a97b4ac6.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 05 Nov 2019 11:33:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lZS2qmmbQU0cEpoYR5sRZAbkSbZyg2geymft6bsgGOjsPcHnKabUPd4sea5WkBI0EAvoHBjTlHyKk7d3AuDgd7MBb/H19d/ETNLaXyPjSjcLKgddKLlonTUJM9PoxC4L0OmQwJWUSJ50/TBjD1kv1Vjh2RwrSyvCJuJzPI38Zb1J2lfB/ZQhccIl0yfgtek+PvKdyCenFAt+wo5PH9mT70aIxyrxZyqeP5abIoYsI1x/jiflkKiID42Htti6TEDa2fW3+WsUOxAz0tcfnz0VALrz4xk0lEmVVdMFaQ45nu13xrQpd6d3nsHwHe0xGoBngc1oU67K/noTEMDUJV4viw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AmhZ769QUM4ka5XRV8owCLuqflejCuCsWW24F1VtZw8=; b=C69kL+j7pyMbvDPGwiOgaCUUbW0hBqFI7cAgpJG9KG67wZWo5x8uCJiiCADcuJVTHUtsQCG5lcTL2zSm6lCGAJwQ/x/yB0aGzRRnWDJGcl+h1pY9btBYRpHaCZjFPdK87gGTr77m+qo59+MdDcXNde5CLJoGyX/Ev0buUqW/8IvVf/hxS/aq6WZOIMkz6VVS21l3JjIGEN2bD+bgMVTTmHGlfLzpdmxEhQI+YVui0PJFyn69VNpvUSpf6JS1u/bfRkQ1rkYfVqbMKtVzmLPhIyg3I2qxuZc0F7yfhlp5mUSJSpPDKjl9o2yk8U+FPyD+645yngvuT25Yx6zwogVzkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AmhZ769QUM4ka5XRV8owCLuqflejCuCsWW24F1VtZw8=; b=M1voKRaR7h5vJMd9gMU1odiD87UyhjFY4PRje6587imIgD9/UgR5buPb6NzL5mJJxvbhWJ3knYpL3D3WOjMjyaCyHCjdF8Mc9LekziCGg9BrhC5CYI4OlYJ9904zRwJyNJpUp6g7uCliEf4SwzGwmt5HfWLUKzG8K4rLnvSQfsw= Received: from HE1PR0802MB2251.eurprd08.prod.outlook.com (10.172.131.21) by HE1PR0802MB2313.eurprd08.prod.outlook.com (10.172.127.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.24; Tue, 5 Nov 2019 11:33:52 +0000 Received: from HE1PR0802MB2251.eurprd08.prod.outlook.com ([fe80::e120:9a38:bcf4:6075]) by HE1PR0802MB2251.eurprd08.prod.outlook.com ([fe80::e120:9a38:bcf4:6075%5]) with mapi id 15.20.2408.024; Tue, 5 Nov 2019 11:33:52 +0000 From: Matthew Malcomson To: "gcc-patches@gcc.gnu.org" CC: nd , "rguenther@suse.de" , "law@redhat.com" , Martin Liska , Richard Earnshaw , Kyrylo Tkachov , "ian@airs.com" Subject: [PATCH 1/X][mid-end] Fix declared type of personality functions Date: Tue, 5 Nov 2019 11:33:52 +0000 Message-ID: References: <157295142743.27946.1142544630216676787.scripted-patch-series@arm.com> In-Reply-To: <157295142743.27946.1142544630216676787.scripted-patch-series@arm.com> Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Matthew.Malcomson@arm.com; x-ms-exchange-transport-forked: True x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:6430;OLM:6430; X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(376002)(136003)(396003)(366004)(39860400002)(346002)(54534003)(189003)(199004)(11346002)(446003)(66616009)(5660300002)(26005)(102836004)(7696005)(2501003)(6506007)(7736002)(8676002)(81156014)(81166006)(33656002)(478600001)(74316002)(2906002)(76176011)(186003)(386003)(99936001)(8936002)(14454004)(2351001)(44832011)(486006)(476003)(66476007)(316002)(52116002)(71190400001)(6116002)(25786009)(3846002)(305945005)(54906003)(86362001)(66066001)(9686003)(6436002)(5024004)(5640700003)(4326008)(55016002)(99286004)(14444005)(66446008)(71200400001)(66556008)(52536014)(66946007)(64756008)(256004)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0802MB2313; H:HE1PR0802MB2251.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: cxW2/n3lD2zfBWMHOMht+jgadCKDFV9xsCCf3RydbLpupSsoUTwzqIH2WLpkaYKdACm96a0IbZF2JT/vrGxBp+kuOEe4A8+7ejZBP48n9yMPwH33+mTgNUceiVwnQa23nOLNGaG+4nHu5m3NxUo3H6XvDlWgeaBfe7XVpzj1oTMNBWmAaUA3l8xUwfWsBp0a5716UrabUWdoFsIDI+78b+qcSzOLWxWAwyvFi3PsfhB5BFm6ULgX0OvOJ2MxA5bdTk3CO/Ni+HL62/47gUO3Q3oNx1+mBLecpNu8JnizKTlHLfLoyOtPMRySmmCxtQJWMu7FoU8PKtYC4SNuEe+G05b2YJl0jE0r/vqHXwovK6Q5EITXS9QTDrkby84/PI73nvmtSjIwT+vCFq1qZ2gszbT1hL7Ufl85SGl3y0oLDKo0FLeY0iuIG0DflBTW4hNt MIME-Version: 1.0 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Matthew.Malcomson@arm.com; X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT026.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 9f5ce4fe-81af-405a-09db-08d761e40877 X-IsSubscribed: yes `build_personality_function` generates a declaration for a personality function. The type it declares for these functions doesn't match the type of the actual personality functions that are defined by the C++ unwinding ABI. This doesn't cause any crashes since the compiler never generates a call to these decl's, and hence the type of the function is never used. Nonetheless, for the sake of consistency and readability we update the type of this declaration. (See libstdc++-v3/libsupc++/unwind-cxx.h for declaration of _gxx_personality_v0 to compare types). gcc/ChangeLog: 2019-11-05 Matthew Malcomson * expr.c (build_personality_function): Fix generated type to match actual personality functions. ############### Attachment also inlined for ease of reply ############### diff --git a/gcc/expr.c b/gcc/expr.c index 2f2b53f8b6905013b4214eea137d67c666b0c795..7dc37a288ebffb99c990442cf339b848c5fa9d2e 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -12525,7 +12525,8 @@ build_personality_function (const char *lang) name = ACONCAT (("__", lang, "_personality", unwind_and_version, NULL)); - type = build_function_type_list (integer_type_node, integer_type_node, + type = build_function_type_list (unsigned_type_node, + integer_type_node, integer_type_node, long_long_unsigned_type_node, ptr_type_node, ptr_type_node, NULL_TREE); decl = build_decl (UNKNOWN_LOCATION, FUNCTION_DECL, diff --git a/gcc/expr.c b/gcc/expr.c index 2f2b53f8b6905013b4214eea137d67c666b0c795..7dc37a288ebffb99c990442cf339b848c5fa9d2e 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -12525,7 +12525,8 @@ build_personality_function (const char *lang) name = ACONCAT (("__", lang, "_personality", unwind_and_version, NULL)); - type = build_function_type_list (integer_type_node, integer_type_node, + type = build_function_type_list (unsigned_type_node, + integer_type_node, integer_type_node, long_long_unsigned_type_node, ptr_type_node, ptr_type_node, NULL_TREE); decl = build_decl (UNKNOWN_LOCATION, FUNCTION_DECL,