From patchwork Wed Jan 16 20:42:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1026201 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-494177-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gdcproject.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="lP4PNYzJ"; 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 43fzgK1jCbz9sDP for ; Thu, 17 Jan 2019 07:43:07 +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 :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=k8cSJJu2sO7V7CK/Wm5Van3awdvKQqxV8laIbKgLylwG5E 0iG/vFRE/IABjqJc9LtyUcokCUvL6uonNBH1cPb4quXN4OGo08v99m3TSRwboQMo pg0CabM90oWkYR+S0YDdcuiTNQ2oJtn4+QmHnYgJAkCK8ng7carBgRdZBf28E= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=ELf9DRp2AAZ0V2w9q++aDU4l5Ec=; b=lP4PNYzJiWfyA196fdzW RXvUPdj8DIOnoMYwlAaR2nvDhbc1hrh82404RtO4NcCSthwb1Ry05M9pkKHVyZ1L j+wsD3JZ51SIz3s9u2R5US68t4wn68/w1eBhJrjR58rK0rbD4MxK7DPosj7+jApt 19vJPw44LsqqxHJea9k4wQg= Received: (qmail 97793 invoked by alias); 16 Jan 2019 20:43:00 -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 97715 invoked by uid 89); 16 Jan 2019 20:42:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qt1-f180.google.com Received: from mail-qt1-f180.google.com (HELO mail-qt1-f180.google.com) (209.85.160.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 16 Jan 2019 20:42:57 +0000 Received: by mail-qt1-f180.google.com with SMTP id r14so8906649qtp.1 for ; Wed, 16 Jan 2019 12:42:57 -0800 (PST) MIME-Version: 1.0 From: Iain Buclaw Date: Wed, 16 Jan 2019 21:42:44 +0100 Message-ID: Subject: [PATCH, PR d/87824] Committed fix for failing EH execution test on i386. To: gcc-patches X-IsSubscribed: yes Hi, This patches fixes one of the problems noted in PR d/87824, where exception chaining does not work as per expected semantics if -forder-blocks-and-partition is enabled on i386. Having it default off if not explicitly given seems the most reasonable thing to do, as there's no alternative way to determine if two in-flight exceptions should be chained at run-time if this optimization is turned on. Bootstrapped and tested on x86_64-linux-gnu / RUNTESTFLAGS="--target_board=unix/-m32" Committed to trunk as r267985. diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc index 109bf4bf139..b53e56e65a2 100644 --- a/gcc/d/d-lang.cc +++ b/gcc/d/d-lang.cc @@ -725,6 +725,12 @@ d_post_options (const char ** fn) global.params.useSwitchError = false; } + /* Turn off partitioning unless it was explicitly requested, as it doesn't + work with D exception chaining, where EH handler uses LSDA to determine + whether two thrown exception are in the same context. */ + if (!global_options_set.x_flag_reorder_blocks_and_partition) + global_options.x_flag_reorder_blocks_and_partition = 0; + /* Error about use of deprecated features. */ if (global.params.useDeprecated == DIAGNOSTICinform && global.params.warnings == DIAGNOSTICerror)