From patchwork Wed Oct 28 17:47:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Monakov X-Patchwork-Id: 537509 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 46877141351 for ; Thu, 29 Oct 2015 04:47:30 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=MIQrzf6y; 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:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=kzKt9Dq/gIyCTg+odgyVhkDPQw9wVKZOQSWCDe/Iri7p0DlZdJ vqHW6tLHL+65DI4h1n3QMCJMgItk1vdg5/GBxPudl0WkJ7OY/33Wi9YchAXW4Nqe xuDZ22Azp+mp2lYBSRvVcNVcbe97fxaGtT7ZL+BfXkTsK/qRZKUY+Mpd8= 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:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=MXbfg530hzPFQH3mXyVpbvZGddQ=; b=MIQrzf6yeRf5HppA6kY/ /IuOTCIiOSdD2mtUSP39GyFTCCuKR/PsImMbYScBxXAlMGiDoEaKdVDx+6JQIZ9E mtmbqIBT/gK9LKxhpcCYPMTXjIixbwHUKrLiw9BvSOcmQSmUZxrbYIUoHlr9DGxJ +cDSrOYPCgqz/8z7zax8tKk= Received: (qmail 44249 invoked by alias); 28 Oct 2015 17:47:22 -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 44240 invoked by uid 89); 28 Oct 2015 17:47:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: smtp.ispras.ru Received: from smtp.ispras.ru (HELO smtp.ispras.ru) (83.149.199.79) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Oct 2015 17:47:21 +0000 Received: from [10.10.3.121] (unknown [83.149.199.91]) by smtp.ispras.ru (Postfix) with ESMTP id D500020514; Wed, 28 Oct 2015 20:47:18 +0300 (MSK) Date: Wed, 28 Oct 2015 20:47:18 +0300 (MSK) From: Alexander Monakov To: gcc-patches@gcc.gnu.org cc: Richard Henderson Subject: Fix for PR sanitize/65000 introduces an unusual gcc_assert Message-ID: User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Hello Richard, Your commit to fix PR 65000 (pasted below) introduced gcc_assert (ri = (int)ri); I'm unclear what is meant there; if equality test was meant, that looks suspicious to me because truncating conversion is implementation-defined. Can you please comment? (I found this after noticing assignment-in-assertion in nvptx.c, but apart from two instances there and this one, I didn't find others in GCC) Thanks. Alexander PR sanitize/65000 * tree-eh.c (mark_reachable_handlers): Mark source and destination regions of __builtin_eh_copy_values. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220626 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 159fa2b..3c45f37 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -3859,6 +3859,17 @@ mark_reachable_handlers (sbitmap *r_reachablep, sbitmap *lp_reachablep) gimple_eh_dispatch_region ( as_a (stmt))); break; + case GIMPLE_CALL: + if (gimple_call_builtin_p (stmt, BUILT_IN_EH_COPY_VALUES)) + for (int i = 0; i < 2; ++i) + { + tree rt = gimple_call_arg (stmt, i); + HOST_WIDE_INT ri = tree_to_shwi (rt); + + gcc_assert (ri = (int)ri); + bitmap_set_bit (r_reachable, ri); + } + break; default: break; }