From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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 17:51:00 -0000 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 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2015-10/txt/msg03082.txt.bz2 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; }