public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Uecker <muecker@gwdg.de>
To: Paul Floyd <paulf@free.fr>, "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: Safe transposition of logical and operands
Date: Mon, 18 Sep 2023 22:52:16 +0200	[thread overview]
Message-ID: <36ac57c1e19b68fd588208a9ac03b58fe29fab32.camel@gwdg.de> (raw)
In-Reply-To: <1dbda88a-60dd-bb00-1217-244d111598fb@free.fr>

Am Montag, dem 18.09.2023 um 22:15 +0200 schrieb Paul Floyd via Gcc:
> 
> On 18-09-23 21:09, Martin Uecker wrote:
> 
> > I do not understand why memcheck cares about the potential trap when
> > deciding to do the backwards transformation that combines the two
> > comparisons?  Can't you just remove this condition?  I assume it
> > is meant as a filter to only transform cases which really come
> > from an '&&' condition in the source, but as this example show, this
> > is too strict. Or am I missing something?
> 
> My understanding is that this is a generic transformation of
> 
> if (a && b) [which might have been transposed from if (b && a)]
> 
> into
> 
> if (a & b) [with appropriate extension to the right size].
> 
> That means both get evaluated and we can't take that risk that one of 
> them traps.

Is the problem that valgrind transforms the code before it then
emulates it and the problem is that during emulation the code
could trap?

Martin




  reply	other threads:[~2023-09-18 20:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-17 19:33 Paul Floyd
2023-09-17 20:51 ` Jonathan Wakely
2023-09-18  7:03   ` Paul Floyd
2023-09-18  7:23     ` Jonathan Wakely
2023-09-18  8:00       ` Richard Biener
2023-09-18 14:46         ` Floyd, Paul
2023-09-18 14:55           ` Richard Biener
2023-09-18 17:56             ` Paul Floyd
2023-09-18 19:09               ` Martin Uecker
2023-09-18 20:15                 ` Paul Floyd
2023-09-18 20:52                   ` Martin Uecker [this message]
2023-09-19  5:03                     ` Paul Floyd
2023-09-18  9:36       ` Jonathan Wakely
2023-09-18 10:30 ` Andreas Schwab

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=36ac57c1e19b68fd588208a9ac03b58fe29fab32.camel@gwdg.de \
    --to=muecker@gwdg.de \
    --cc=gcc@gcc.gnu.org \
    --cc=paulf@free.fr \
    /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).