public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <richard.guenther@gmail.com>
To: Jeff Law <law@redhat.com>
Cc: Tom Tromey <tromey@redhat.com>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: RFA: New pass to delete unexecutable paths in the CFG
Date: Mon, 07 Nov 2011 15:54:00 -0000	[thread overview]
Message-ID: <CAFiYyc0_yrN7spUSS2RgM2TtjOQDbmXNTXyOwio+mxK89NRw9A@mail.gmail.com> (raw)
In-Reply-To: <4EB7FCAA.10100@redhat.com>

On Mon, Nov 7, 2011 at 4:43 PM, Jeff Law <law@redhat.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 11/07/11 06:53, Tom Tromey wrote:
>>>>>>> "Jeff" == Jeff Law <law@redhat.com> writes:
>>
>> Jeff> First, it's perfectly fine to have a NULL pointer dereference
>> in a Jeff> program as long as that code is never executed.  Once
>> the code is Jeff> executed, we've entered the realm of undefined
>> behavior.
>>
>> Jeff> Thus in a conforming program we can safely assume that a
>> provable NULL Jeff> pointer dereference can never be executed at
>> runtime.  This implies Jeff> there is a path through the CFG that
>> is unexecutable.
>>
>> IIUC, then this isn't true for Java.  In Java the attempt to
>> dereference NULL throws a NullPointerException, which can be
>> caught, etc.  It isn't undefined.
> So, presumably there's no way to know we're throwing to
> NullPointerException from the exception information attached to the
> statement or BB?  If not I could disable if the statement with the
> memory op throws anywhere.  It's not ideal, but conservatively correct.

Well, stmt_could_throw_p says that (java has non-call exceptions).

OTOH I'm not sure we want to change a possible trap (And thus
program abort) to a fallthru ...

Richard.

  reply	other threads:[~2011-11-07 15:49 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07  9:58 Jeff Law
2011-11-07 10:19 ` Jakub Jelinek
2011-11-07 10:21   ` Richard Guenther
2011-11-07 10:30     ` Richard Guenther
2011-11-07 19:20       ` Jeff Law
2011-11-07 16:14     ` Jeff Law
2011-11-07 16:30       ` Richard Guenther
2011-11-07 16:57         ` Kai Tietz
2011-11-07 19:03         ` Jeff Law
2011-11-08 11:50           ` Paolo Bonzini
2011-11-08 19:48             ` Jeff Law
2011-11-08 20:38               ` Paolo Bonzini
2011-11-08 20:59                 ` Jeff Law
2011-11-09  8:37                   ` Paolo Bonzini
2011-11-09 18:11                     ` Jeff Law
2011-11-09 18:12                       ` Jakub Jelinek
2011-11-09 22:45                       ` Paolo Bonzini
2011-11-10 19:27                         ` Jeff Law
2011-11-07 19:14   ` Jeff Law
2011-11-07 14:16 ` Tom Tromey
2011-11-07 15:54   ` Jeff Law
2011-11-07 15:54     ` Richard Guenther [this message]
2011-11-07 19:09       ` Jeff Law
2011-11-07 22:34         ` Richard Guenther
2011-11-08 20:02           ` Jeff Law
2011-11-09  9:50             ` Richard Guenther
2011-11-09 17:43               ` Jeff Law
2011-11-07 15:55     ` Tom Tromey
2011-11-07 17:01       ` Paolo Bonzini
2011-11-15  7:52         ` RFA: disable -fdelete-null-pointer-checks for Java Jeff Law
2011-11-07 19:05       ` RFA: New pass to delete unexecutable paths in the CFG Jeff Law

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=CAFiYyc0_yrN7spUSS2RgM2TtjOQDbmXNTXyOwio+mxK89NRw9A@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=tromey@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).