From patchwork Sun Nov 13 22:31:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 694282 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tH7g62Drxz9t1P for ; Mon, 14 Nov 2016 09:31:46 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="WrUhwkrk"; dkim-atps=neutral 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:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=WQuYqWggshxrNHed fOLbgdzf0duVfCjKoDHUAJymGnXNTGas92c76d2NiOvh1fesp1SknQvz+k/sZE1p 5qzw/5IB24d3nzLoiMCAUKYP1TSeNLpOt1lj4R1nEWDACYN2+Ruj3gDt1fNg1VXn +cL5/vEtO+y1ungfQ8TmzCtqWaQ= 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:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=jWgLI7zpJ+rM0kPJ+vGPUm 0VYjE=; b=WrUhwkrkl5TRog5OlkFC6xl330D7EJM41nvOL214t/uRlyWZlGyXN2 IXqZ3NgrAJQBM02Y6iKSRlHOlqLhaQLlOy2qNF24lmVz4y/n62SDIfM+4ryai7LE 0yI7sNO6aDyp9COHep1LydV50h2GFm+thMrgCaxICMidhhG2fniyQ= Received: (qmail 22742 invoked by alias); 13 Nov 2016 22:31:38 -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 22730 invoked by uid 89); 13 Nov 2016 22:31:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1136 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 ESMTP; Sun, 13 Nov 2016 22:31:31 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id C89C7812EB for ; Sun, 13 Nov 2016 23:31:29 +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 0o7madhAB2s3 for ; Sun, 13 Nov 2016 23:31:29 +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 A7DC9812DD for ; Sun, 13 Nov 2016 23:31:29 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [MIPS] Enable descriptors for nested functions in Ada Date: Sun, 13 Nov 2016 23:31:29 +0100 Message-ID: <1686875.o51Xv5tRQl@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-48-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 Similarly to x86, PowerPC and SPARC, this enables the use of custom run-time descriptors in Ada, thus eliminating the need for trampolines and executable stack in presence of pointers to nested functions. Unfortunately I don't have access to MIPS hardware any more, but the scheme was tested on the architecture at some point. OK for the mainline? 2016-11-13 Eric Botcazou PR ada/67205 * config/mips/mips.c (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): Define. Index: config/mips/mips.c =================================================================== --- config/mips/mips.c (revision 242334) +++ config/mips/mips.c (working copy) @@ -22387,6 +22387,10 @@ mips_promote_function_mode (const_tree t #undef TARGET_HARD_REGNO_SCRATCH_OK #define TARGET_HARD_REGNO_SCRATCH_OK mips_hard_regno_scratch_ok +/* The architecture reserves bit 0 for MIPS16 so use bit 1 for descriptors. */ +#undef TARGET_CUSTOM_FUNCTION_DESCRIPTORS +#define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 2 + struct gcc_target targetm = TARGET_INITIALIZER; #include "gt-mips.h"