From: Robert Dewar <dewar@adacore.com>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: Richard Guenther <rguenther@suse.de>,
"Joseph S. Myers" <joseph@codesourcery.com>,
Mark Mitchell <mark@codesourcery.com>,
gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org
Subject: Re: [PATCH][4.3] Deprecate -ftrapv
Date: Sat, 01 Mar 2008 20:11:00 -0000 [thread overview]
Message-ID: <47C9B864.8020608@adacore.com> (raw)
In-Reply-To: <874pbq1aso.fsf@mid.deneb.enyo.de>
Florian Weimer wrote:
> * Robert Dewar:
>
>> So here's exactly what happens now in Ada
>>
>> 1. If -gnato is not set (no overflow checking)
>>
>> In this case, the situation is exactly the same as C, and the front end
>> ignores the possibility of overflow.
>
> It's C in -fwrapv mode, isn't it? (Otherwise, you can't really get the
> other constraint checks to work, including bounds checking for array
> access.)
No, it is exactly C, if an arithmetic operation causes overflow
and you do not have -gnato set, and overflow occurs, the program
execution is erroneous. I reread the last para above more than once
but cannot guess what you are getting.
>
>> The official Ada semantics are that if you suppress overflow checks,
>> and an overflow occurs (intermediate or otherwise), the executino is
>> erroneous (undefined in C-speak). So Ada with checks off is in all
>> respects identical to C semantics. No problem.
>
> Uh-oh, this is really, really surprising.
Why is it surprising, if you suppress overflow checks you are saying
that overflow does not occur, just as you say this for *any* C program.
I don't understand the surprise or the concern here, can you
elucidate?
If you think your program might have integer overflow, and
you want to check for this, you must use -gnato.
next prev parent reply other threads:[~2008-03-01 20:11 UTC|newest]
Thread overview: 75+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.64.0803010041110.4133@zhemvz.fhfr.qr>
2008-03-01 0:04 ` Richard Guenther
2008-03-01 0:05 ` Mark Mitchell
2008-03-01 0:11 ` Richard Kenner
2008-03-01 2:05 ` Robert Dewar
2008-03-01 2:17 ` Joseph S. Myers
2008-03-01 2:33 ` Robert Dewar
2008-03-01 13:19 ` Joseph S. Myers
2008-03-01 14:05 ` Paolo Bonzini
2008-03-01 11:24 ` Richard Kenner
2008-03-01 13:55 ` Robert Dewar
2008-03-01 14:12 ` Richard Kenner
2008-03-01 14:18 ` Robert Dewar
2008-03-01 0:14 ` Richard Guenther
2008-03-01 1:04 ` Mark Mitchell
2008-03-01 1:49 ` Joseph S. Myers
2008-03-01 1:54 ` Mark Mitchell
2008-03-01 12:32 ` Richard Guenther
2008-03-01 13:10 ` Joseph S. Myers
2008-03-01 13:38 ` Robert Dewar
2008-03-01 13:57 ` Richard Guenther
2008-03-01 14:05 ` Robert Dewar
2008-03-01 19:53 ` Florian Weimer
2008-03-01 20:11 ` Robert Dewar [this message]
2008-03-01 21:19 ` Florian Weimer
2008-03-01 21:43 ` Robert Dewar
2008-03-01 21:48 ` Robert Dewar
2008-03-01 14:14 ` Richard Kenner
2008-03-01 13:50 ` Richard Guenther
2008-03-01 18:27 ` Joseph S. Myers
2008-03-01 14:06 ` Richard Kenner
2008-03-01 14:10 ` Richard Guenther
2008-03-01 14:15 ` Robert Dewar
2008-03-01 14:13 ` Robert Dewar
2008-03-01 14:15 ` Paolo Bonzini
2008-03-01 18:32 ` Joseph S. Myers
2008-03-02 10:47 ` Mark Mitchell
2008-03-02 11:08 ` Richard Guenther
2008-03-02 11:52 ` Robert Dewar
2008-03-03 22:45 ` Eric Botcazou
2008-03-04 2:38 ` Robert Dewar
2008-03-03 18:36 ` Ian Lance Taylor
2008-03-02 11:29 ` Robert Dewar
2008-03-02 11:36 ` Richard Kenner
2008-03-02 14:24 ` Frank Ch. Eigler
2008-03-02 14:31 ` Robert Dewar
2008-03-02 15:14 ` Frank Ch. Eigler
2008-03-02 15:21 ` Robert Dewar
2008-03-02 15:48 ` Frank Ch. Eigler
2008-03-02 16:08 ` Robert Dewar
2008-03-02 15:22 ` Robert Dewar
2008-03-01 19:58 ` Florian Weimer
2008-03-01 20:04 ` Florian Weimer
2008-03-01 20:12 ` Robert Dewar
2008-03-01 21:25 ` Florian Weimer
2008-03-01 21:45 ` Robert Dewar
2008-03-01 12:31 ` Richard Guenther
2008-03-01 14:00 ` Paolo Bonzini
2008-03-02 13:00 ` Joseph S. Myers
2008-03-02 13:03 ` Richard Guenther
2008-03-05 22:46 ` Ken Raeburn
2008-03-01 0:16 ` David Daney
2008-03-01 2:08 ` Robert Dewar
2008-03-01 6:54 ` Tom Tromey
2008-03-01 0:12 ` Joseph S. Myers
2008-03-01 0:23 ` Richard Guenther
2008-03-01 0:49 ` Joseph S. Myers
2008-03-01 1:57 ` Robert Dewar
2008-03-01 12:33 ` Richard Guenther
2008-03-01 13:08 ` Robert Dewar
[not found] ` <fqbn6k$d5j$1@ger.gmane.org>
2008-03-01 13:58 ` Robert Dewar
2008-03-01 14:00 ` Richard Guenther
2008-03-03 22:53 ` Eric Botcazou
2008-03-04 2:39 ` Robert Dewar
2008-03-01 22:16 FX Coudert
2008-03-01 22:31 ` Robert Dewar
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=47C9B864.8020608@adacore.com \
--to=dewar@adacore.com \
--cc=fw@deneb.enyo.de \
--cc=gcc-patches@gcc.gnu.org \
--cc=gcc@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=mark@codesourcery.com \
--cc=rguenther@suse.de \
/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).