public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Gcc Patch List <gcc-patches@gcc.gnu.org>,
	Jason Merrill <jason@redhat.com>,
	"Joseph S. Myers" <joseph@codesourcery.com>
Subject: PING 2 [PATCH] integer overflow checking builtins in constant expressions
Date: Mon, 16 May 2016 19:30:00 -0000	[thread overview]
Message-ID: <573A1FB0.3060901@gmail.com> (raw)
In-Reply-To: <5730BD1B.40109@gmail.com>

Ping 2 of the following patch:
   https://gcc.gnu.org/ml/gcc-patches/2016-05/msg00013.html

On 05/09/2016 10:38 AM, Martin Sebor wrote:
> Pinging the following patch:
>    https://gcc.gnu.org/ml/gcc-patches/2016-05/msg00013.html
>
> On 05/01/2016 10:39 AM, Martin Sebor wrote:
>> c/68120 - can't easily deal with integer overflow at compile time,
>> is an enhancement request to make the integer overflow intrinsics
>> usable in constant expressions in C (in addition to letting them
>> be invoked with just two arguments).
>>
>> The inability to use the built-ins in constant expressions also
>> limited to non-constexpr the contexts in which the patch for c++/
>> 69517 - SEGV on a VLA with excess initializer elements, was able
>> to prevent the SEGV.  This limitation is noted in c++/70507 -
>> integer overflow builtins not constant expressions.
>>
>> The attached patch implements the request in c/68120 for both
>> the C and C++ front-ends.  It stops short of providing the new
>> __builtin_add_wrapv function requested in c/68120.  It doesn't
>> seem necessary since the same functionality is available with
>> the patch via the existing built-ins.
>>
>> With this enhancement in place it will be possible to add the
>> C++ VLA checking to constexpr functions and fully resolve c++/
>> 69517 (which I plan to do next).
>>
>> While testing the patch, I also noticed an minor inconsistency
>> in the text of the diagnostic GCC issues for invalid calls to
>> the built-ins with insufficient numbers of arguments:  for one
>> set of built-ins the error says: "not enough arguments," while
>> for another it says: "too few arguments."  I raised PR c/70883
>> - inconsistent error message for calls to __builtin_add_overflow
>> with too few arguments, for this and include a fix in this patch
>> as well.
>>
>> Martin
>>
>> PS The enhancement to call the type-generic built-ins with a null
>> pointer is not available in C++ 98 mode because GCC doesn't allow
>> null pointers in constant expressions.  Since C and later versions
>> of C++ do, it seems that it might be worthwhile to relax the rules
>> and accept them in C++ 98 as well so that the built-ins can be used
>> portably across all versions of C++.
>>
>

  reply	other threads:[~2016-05-16 19:30 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-01 16:40 Martin Sebor
2016-05-09 16:39 ` PING " Martin Sebor
2016-05-16 19:30   ` Martin Sebor [this message]
2016-05-17 18:54 ` Jason Merrill
2016-05-31 23:43   ` Martin Sebor
     [not found] ` <20160531215025.GK28550@tucnak.redhat.com>
     [not found]   ` <574E13DD.9040401@gmail.com>
2016-06-01  7:52     ` Jakub Jelinek
2016-06-01 15:17       ` Martin Sebor
2016-06-01 15:45         ` Jakub Jelinek
2016-06-01 16:13           ` Martin Sebor
2016-06-02  3:11         ` Martin Sebor
2016-06-02  7:23           ` Jakub Jelinek
2016-06-02  7:34             ` Jakub Jelinek
2016-06-03 15:07               ` Martin Sebor
2016-06-03 15:23                 ` Jakub Jelinek
2016-06-03 16:22                   ` Martin Sebor
2016-06-02 23:21             ` Martin Sebor
2016-06-03  0:28               ` Martin Sebor
2016-06-03  7:06                 ` Jakub Jelinek
2016-06-03 15:29                   ` Martin Sebor
2016-06-03 15:32                     ` Jakub Jelinek
2016-06-03 20:09                       ` Martin Sebor
2016-06-06 12:36                         ` Jakub Jelinek
2016-06-06 19:44                           ` Jakub Jelinek
2016-06-07  9:12                             ` Marek Polacek
2016-06-07 14:32                           ` Jason Merrill
2016-06-07 15:51                             ` Martin Sebor
2016-06-07 16:34                               ` Jakub Jelinek
2016-06-07 19:35                                 ` Jason Merrill
2016-06-07 19:42                                   ` Jakub Jelinek
2016-06-07 20:30                                     ` Martin Sebor
2016-06-07 20:52                                       ` Jakub Jelinek
2016-06-07 21:56                                         ` Martin Sebor
2016-06-08  7:23                                           ` Jakub Jelinek
2016-06-08 18:38                                             ` Jason Merrill
2016-06-07 19:36                               ` Jason Merrill
2016-06-01 18:46     ` Jason Merrill

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=573A1FB0.3060901@gmail.com \
    --to=msebor@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=joseph@codesourcery.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).