public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <rguenther@suse.de>
To: Arnaud Charlet <charlet@adacore.com>
Cc: gcc-patches@gcc.gnu.org, Eric Botcazou <botcazou@adacore.com>
Subject: Re: [PATCH] Keep lattice abstract in the SSA propagator, substitue lattice values at defs
Date: Wed, 04 Aug 2010 12:49:00 -0000	[thread overview]
Message-ID: <alpine.LNX.2.00.1008041437130.25856@zhemvz.fhfr.qr> (raw)
In-Reply-To: <20100804123142.GA83420@adacore.com>

On Wed, 4 Aug 2010, Arnaud Charlet wrote:

> > > > Bootstrapped and tested on x86_64-unknown-linux-gnu.  c52102b
> > > > and c52102d now fail, because they rely on undefined signed integer
> > > > overflow.
> > > 
> > > Ada ACATS tests do not rely on signed integer overflow: Ada has built-in
> > > overflow checks as part of the language, but this capability requires the
> > > -gnato switch.
> > > 
> > > If these tests are failing, it means the -gnato switch is missing on these
> > > tests.
> > > 
> > > Can you please fix that by updating
> > > gcc/testsuite/ada/acats/overflow.lst ?
> > > Thanks in advance.
> > 
> > Adding -gnato doesn't fix the testcases (checked c52102b).
> 
> Well, then there's something fishy here that needs to be investigated, can you
> expand on why these tests "rely on undefined signed integer overflow" ?

I looked at the VRP dump and it derives perfectly valid assumptions.
From

  <various bounds checking concludes ident_int_2_12 is [1, 4]
   and ident_int_1_10 is [1, 4]>

<bb 15>:
  D.2465_155 = ident_int_2_12 + 1;
  L27b_156 = D.2465_155 - ident_int_1_10;
  L29b_159 = L27b_156 + 1;

<bb 16>:
  # L29b_363 = PHI <L29b_159(15), 1(14)>
...

  and we arrive with [-3, 9] for prephitmp.53_302 and [-1, 5] for L29b_363

  if (prephitmp.53_302 > L29b_363)
    goto <bb 27>;

<bb 27>:

  thus we can conclude that prephitmp.53_302 is [0, 9] here.
  The following statement then produces a range of [2147483647, overflow].
  So we happily substitute a constant value of 2147483647 for D.2544_253.

  D.2544_253 = prephitmp.53_302 + 2147483647;
  D.2553_254 = (size_type) D.2544_253;
...
  D.2554_257 = D.2553_254 + 1;


Richard.

  reply	other threads:[~2010-08-04 12:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-04 12:22 Richard Guenther
2010-08-04 12:26 ` Arnaud Charlet
2010-08-04 12:29   ` Richard Guenther
2010-08-04 12:31     ` Arnaud Charlet
2010-08-04 12:49       ` Richard Guenther [this message]
2010-08-04 12:57         ` Eric Botcazou
2010-08-04 12:58         ` Richard Guenther
2010-08-04 13:27           ` Eric Botcazou
2010-08-08  8:01         ` Eric Botcazou
2010-08-08  8:44           ` Richard Guenther
2010-08-08 12:09             ` Paolo Bonzini
2010-08-08 12:12               ` Paolo Bonzini
2010-08-08 12:28               ` Richard Guenther
2010-08-08 12:37                 ` Richard Guenther
2010-08-08 13:36                   ` Richard Guenther
2010-08-08 22:46                     ` Eric Botcazou

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.00.1008041437130.25856@zhemvz.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=botcazou@adacore.com \
    --cc=charlet@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).