public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Richard Biener <richard.guenther@gmail.com>,
	gcc-patches@gcc.gnu.org, Richard Biener <rguenther@suse.de>
Subject: Re: [PATCH][RFC] Enable -fstrict-overflow by default
Date: Tue, 25 Apr 2017 15:23:00 -0000	[thread overview]
Message-ID: <b85c7723-1179-7f7f-40ed-c1ca688b4c89@redhat.com> (raw)
In-Reply-To: <1E531173-E2BC-4528-9D81-FF179F4961BD@gmail.com>

On 04/25/2017 09:09 AM, Richard Biener wrote:
> On April 25, 2017 4:39:49 PM GMT+02:00, Jeff Law <law@redhat.com> wrote:
>> On 04/24/2017 05:25 AM, Richard Biener wrote:
>>>
>>> The following makes signed overflow undefined for all
>> (non-)optimization
>>> levels.  The intent is to remove -fno-strict-overflow signed overflow
>>> behavior as that is not a sensible option to the user (it ends up
>>> with the worst of both -fwrapv and -fno-wrapv).  The implementation
>>> details need to be preserved for the forseeable future to not wreck
>>> UBSAN with either associating (-fwrapv behavior) or optimizing
>>> (-fno-wrapv behavior).
>>>
>>> The other choice would be to make -fwrapv the default for -O[01].
>>>
>>> A second patch in this series would unify -f[no-]wrapv, -f[no-]trapv
>>> and -f[no-]strict-overflow with a
>>> -fsigned-integer-overflow={undefined,wrapping,trapping[,sanitized]}
>>> option, making conflicts amongst the options explicit (and reduce
>>> the number of flag_ variables).  'sanitized' would essentially map
>>> to todays flag_strict_overflow = 0.  There's another sole user
>>> of flag_strict_overflow, POINTER_TYPE_OVERFLOW_UNDEFINED - not sure
>>> what to do about that, apart from exposing it as different flag
>>> alltogether.
>>>
>>> Further patches in the series would remove -Wstrict-overflow (and
>>> cleanup VRP for example).
>>>
>>> Anyway, most controversical part(?) below.
>>>
>>> Any comments on this particular patch (and the overall proposal)?
>>>
>>> Cleaning up the options is probably a no-brainer anyways.
>>>
>>> Thanks,
>>> Richard.
>>>
>>> 2017-04-24  Richard Biener  <rguenther@suse.de>
>>>
>>> 	* common.opt (fstrict-overflow): Enable by default.
>>> 	* opts.c (default_options_table): Remove OPT_fstrict_overflow entry.
>> Presumably when this work is complete -fno-strict-overflow will give
>> some kind of reasonable error message to the user directing them to the
>>
>> new option that most likely does what they were looking for?
> 
> No, it will simply map to -fwrapv.
That's fine as well.  As long as we do something sane ;-)

jeff

  reply	other threads:[~2017-04-25 15:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-24 11:39 Richard Biener
2017-04-25 15:09 ` Jeff Law
2017-04-25 15:14   ` Richard Biener
2017-04-25 15:23     ` Jeff Law [this message]
2017-04-26  8:52 ` Martin Sebor
2017-04-26  9:13   ` Richard Biener
2017-04-26 17:14     ` Martin Sebor
2017-04-27  9:23       ` Richard Biener
2017-04-28  6:45         ` Martin Sebor

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=b85c7723-1179-7f7f-40ed-c1ca688b4c89@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    --cc=richard.guenther@gmail.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).