From patchwork Mon Sep 14 08:23:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 517307 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 7F54A140082 for ; Mon, 14 Sep 2015 18:29:18 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=VZ1+Jowb; 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=K6Nog6c4W6qsUSFN JDl8cuFBmBuIffmXLMUikIcXEQF08u+8KDk6InTPs9EwEE0U2OTPC97OTd7psC91 625kOM0M41zr6SWTwwflHXISI/JpfunWI2oEy4/PNw+yYPhNnRBo2O0psvwrwOz+ GvsNgupEpXgi7YeoK/K/FWn7fzs= 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=CAcY5cv5z/Fm3VLhkXOmMv amaW0=; b=VZ1+Jowbe+wbGh/uYRokuCw9SGPMqSZywuYf2V6TDKUrty1FHWmLTd V479IIwT0U2994s0KlUpaoSnGDvwdrUEYEfx4Cm4c3uEtVTquF1yTsz/C5ItrfaI l+Ve3KzIOQelkvL5x7584IuA8ZjDtR+dxdnUb8slalv/mIEWZ/Wlc= Received: (qmail 85625 invoked by alias); 14 Sep 2015 08:29:09 -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 84982 invoked by uid 89); 14 Sep 2015 08:29:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL, BAYES_40, 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; Mon, 14 Sep 2015 08:29:07 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 694CF2A30354 for ; Mon, 14 Sep 2015 10:24:43 +0200 (CEST) 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 XKcr5lpOdzT8 for ; Mon, 14 Sep 2015 10:24:21 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 5C2B32A2E226 for ; Mon, 14 Sep 2015 10:23:40 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [patch] Bump size of stack checking protection area Date: Mon, 14 Sep 2015 10:23:16 +0200 Message-ID: <2953624.HgYYlYoG9S@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.29-desktop; KDE/4.7.2; x86_64; ; ) MIME-Version: 1.0 Hi, as documented, STACK_CHECK_PROTECT is supposed to be an "estimate of the amount of stack required to propagate an exception". It's (mainly) for Ada and it needs to distinguish the various EH schemes, which might have different needs. While the current setting is OK for the front-end SJLJ scheme used up to now in Ada, it's not sufficient for the middle-end SJLJ scheme that we are experimenting with; you need 8K on some platforms to pass the ACATS testsuite. Tested on x86_64-suse-linux, OK for the mainline? 2015-09-14 Eric Botcazou * defaults.h (STACK_OLD_CHECK_PROTECT): Adjust for -fno-exceptions. Bump to 4K for SJLJ exceptions. (STACK_CHECK_PROTECT): Likewise. Bump to 8K for SJLJ exceptions. Index: defaults.h =================================================================== --- defaults.h (revision 227729) +++ defaults.h (working copy) @@ -1406,9 +1406,11 @@ see the files COPYING3 and COPYING.RUNTI #define STACK_OLD_CHECK_PROTECT STACK_CHECK_PROTECT #else #define STACK_OLD_CHECK_PROTECT \ - (targetm_common.except_unwind_info (&global_options) == UI_SJLJ \ + (!global_options.x_flag_exceptions \ ? 75 * UNITS_PER_WORD \ - : 8 * 1024) + : targetm_common.except_unwind_info (&global_options) == UI_SJLJ \ + ? 4 * 1024 \ + : 8 * 1024) #endif /* Minimum amount of stack required to recover from an anticipated stack @@ -1416,9 +1418,11 @@ see the files COPYING3 and COPYING.RUNTI of stack required to propagate an exception. */ #ifndef STACK_CHECK_PROTECT #define STACK_CHECK_PROTECT \ - (targetm_common.except_unwind_info (&global_options) == UI_SJLJ \ - ? 75 * UNITS_PER_WORD \ - : 12 * 1024) + (!global_options.x_flag_exceptions \ + ? 4 * 1024 \ + : targetm_common.except_unwind_info (&global_options) == UI_SJLJ \ + ? 8 * 1024 \ + : 12 * 1024) #endif /* Make the maximum frame size be the largest we can and still only need