<div dir="ltr"><div>Greetings SG12,</div><div><br></div><div>I sent the following email yesterday, but received a response that the email to the group was being held for moderation. After waiting more than 24 hours I've not heard back regarding moderation. I'm unsure how to directly contact the moderator. So I'm trying again. I beg your pardon if this leads to duplication.</div><div dir="ltr"><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Scott Schurr<br><a href="mailto:S.Scott.Schurr@gmail.com" target="_blank">S.Scott.Schurr@gmail.com</a></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 28, 2019 at 9:32 AM Scott Schurr <<a href="mailto:s.scott.schurr@gmail.com">s.scott.schurr@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Hello Mr. Glisse,<br clear="all"><div><div dir="ltr" class="gmail-m_-2543417522611737007gmail_signature"><br></div></div><div class="gmail-m_-2543417522611737007gmail_signature">Thanks very much for your interest in paper P1407R0. I appreciate your information about gcc's behavior. If an R1 version of the paper is published it will incorporate both of your points with attribution to you.</div><div class="gmail-m_-2543417522611737007gmail_signature"><br></div><div class="gmail-m_-2543417522611737007gmail_signature">As for the appropriate target, I hear your concerns. Certainly the approach proposed in the paper is far from ideal. The problem comes from arriving at consensus regarding what an ideal, or even good enough, approach would be. My personal opinion is that the status quo is about as far from ideal as we could get. But I also understand that there are plenty of people who disagree with my view.</div><div class="gmail-m_-2543417522611737007gmail_signature"><br></div><div class="gmail-m_-2543417522611737007gmail_signature">Thanks again.</div><div class="gmail-m_-2543417522611737007gmail_signature"><br></div><div class="gmail-m_-2543417522611737007gmail_signature">Scott Schurr</div><div class="gmail-m_-2543417522611737007gmail_signature"><a href="mailto:S.Scott.Schurr@gmail.com" target="_blank">S.Scott.Schurr@gmail.com</a></div><div dir="ltr" class="gmail-m_-2543417522611737007gmail_signature"><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 26, 2019 at 12:44 AM Marc Glisse <<a href="mailto:marc.glisse@inria.fr" target="_blank">marc.glisse@inria.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
just a couple points missing from the paper:<br>
<br>
1) with g++-7 -O2 -Wall, the motivating example on the left produces:<br>
<br>
<source>: In function 'int32_t add_100_without_wrap(int32_t)':<br>
<source>:8:3: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]<br>
if (ret < a)<br>
<br>
However, we removed the warning from gcc-8 because it was too noisy and <br>
impossible to work around when the optimization is what you actually want.<br>
<br>
2) At least with gcc, -ftrapv doesn't really work. You need <br>
-fsanitize=signed-integer-overflow -fsanitize-undefined-trap-on-error for <br>
something roughly equivalent to what -ftrapv is supposed to do.<br>
<br>
<br>
Now my opinion: you have the wrong target. Compilers that have a -fwrapv <br>
option (or -ftrapv or ubsan or ...) already indirectly describe the <br>
default behavior as undefined (and the standard already describes it as <br>
undefined), so it is already documented. Adding a sentence or 2 in the <br>
standard and on pages that nobody reads won't help. It seems that you want <br>
to talk either to teachers, so they warn their students more about the <br>
properties of signed overflow, or to compiler writers, to convince them to <br>
change the default to -fwrapv or -ftrapv (I hope they don't) or add more <br>
warnings.<br>
<br>
-- <br>
Marc Glisse<br>
</blockquote></div></div>
</blockquote></div></div>