public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: gcc-patches@gcc.gnu.org
Cc: Richard Henderson <rth@redhat.com>
Subject: Fix for PR sanitize/65000 introduces an unusual gcc_assert
Date: Wed, 28 Oct 2015 17:51:00 -0000	[thread overview]
Message-ID: <alpine.LNX.2.20.1510282036530.13239@monopod.intra.ispras.ru> (raw)

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 <geh_dispatch *> (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;     
            }            

             reply	other threads:[~2015-10-28 17:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28 17:51 Alexander Monakov [this message]
2015-10-28 18:09 ` Richard Henderson
2015-10-28 19:18   ` Richard Biener
2015-10-28 19:43     ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.20.1510282036530.13239@monopod.intra.ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).