Hello.
As discussed 2 days ago on IRC with Jakub and Jonathan, C++ standard says that
having a non-return
function with missing return statement is undefined behavior. We've got
-fsanitize=return check for
that and we can in such case instrument __builtin_unreachable(). This patch
does that. It
On 10/05/2017 06:53 PM, Martin Liška wrote:
>> We probably want to provide a way to turn off this behavior.
>>
>> If we're going to enable this by default, we probably also want
>> -Wreturn-type on by default.
>
> Agree.
Hi.
So turning on the warning by default for c++, we get about 500 failing
On Thu, Oct 5, 2017 at 12:53 PM, Martin Liška wrote:
> On 10/05/2017 05:07 PM, Jason Merrill wrote:
>> On Thu, Oct 5, 2017 at 6:31 AM, Martin Liška wrote:
>>> As discussed 2 days ago on IRC with Jakub and Jonathan, C++ standard says
>>> that having a non-return
>>> function with missing return st
On 10/11/2017 04:59 PM, Jason Merrill wrote:
> On Thu, Oct 5, 2017 at 12:53 PM, Martin Liška wrote:
>> On 10/05/2017 05:07 PM, Jason Merrill wrote:
>>> On Thu, Oct 5, 2017 at 6:31 AM, Martin Liška wrote:
As discussed 2 days ago on IRC with Jakub and Jonathan, C++ standard says
that havi
On Thu, Oct 12, 2017 at 10:40:42AM +0200, Martin Liška wrote:
> --- a/gcc/cp/constexpr.c
> +++ b/gcc/cp/constexpr.c
> @@ -1175,7 +1175,12 @@ cxx_eval_builtin_function_call (const constexpr_ctx
> *ctx, tree t, tree fun,
> {
> new_call = build_call_array_loc (EXPR_LOCATION (t), TREE_TY
On Thu, Oct 12, 2017 at 4:40 AM, Martin Liška wrote:
> On 10/11/2017 04:59 PM, Jason Merrill wrote:
>> On Thu, Oct 5, 2017 at 12:53 PM, Martin Liška wrote:
>>> On 10/05/2017 05:07 PM, Jason Merrill wrote:
On Thu, Oct 5, 2017 at 6:31 AM, Martin Liška wrote:
> As discussed 2 days ago on I
On 10/12/2017 10:48 AM, Jakub Jelinek wrote:
> On Thu, Oct 12, 2017 at 10:40:42AM +0200, Martin Liška wrote:
>> --- a/gcc/cp/constexpr.c
>> +++ b/gcc/cp/constexpr.c
>> @@ -1175,7 +1175,12 @@ cxx_eval_builtin_function_call (const constexpr_ctx
>> *ctx, tree t, tree fun,
>> {
>>new_call
On Wed, Oct 18, 2017 at 02:46:23PM +0200, Martin Liška wrote:
> On 10/12/2017 10:48 AM, Jakub Jelinek wrote:
> > On Thu, Oct 12, 2017 at 10:40:42AM +0200, Martin Liška wrote:
> >> --- a/gcc/cp/constexpr.c
> >> +++ b/gcc/cp/constexpr.c
> >> @@ -1175,7 +1175,12 @@ cxx_eval_builtin_function_call (cons
On 10/18/2017 02:52 PM, Marek Polacek wrote:
> On Wed, Oct 18, 2017 at 02:46:23PM +0200, Martin Liška wrote:
>> On 10/12/2017 10:48 AM, Jakub Jelinek wrote:
>>> On Thu, Oct 12, 2017 at 10:40:42AM +0200, Martin Liška wrote:
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -1175,7
On 10/18/2017 09:07 AM, Martin Liška wrote:
@@ -1182,7 +1182,13 @@ cxx_eval_builtin_function_call (const constexpr_ctx
*ctx, tree t, tree fun,
{
new_call = build_call_array_loc (EXPR_LOCATION (t), TREE_TYPE (t),
CALL_EXPR_FN (t), nargs
On 10/24/2017 04:19 PM, Jason Merrill wrote:
> On 10/18/2017 09:07 AM, Martin Liška wrote:
>> @@ -1182,7 +1182,13 @@ cxx_eval_builtin_function_call (const constexpr_ctx
>> *ctx, tree t, tree fun,
>> {
>> new_call = build_call_array_loc (EXPR_LOCATION (t), TREE_TYPE (t),
>>
On Thu, Oct 05, 2017 at 12:31:23PM +0200, Martin Liška wrote:
> As discussed 2 days ago on IRC with Jakub and Jonathan, C++ standard says
> that having a non-return
> function with missing return statement is undefined behavior. We've got
> -fsanitize=return check for
> that and we can in such ca
On Thu, Oct 5, 2017 at 6:31 AM, Martin Liška wrote:
> As discussed 2 days ago on IRC with Jakub and Jonathan, C++ standard says
> that having a non-return
> function with missing return statement is undefined behavior. We've got
> -fsanitize=return check for
> that and we can in such case instru
On 10/05/2017 05:07 PM, Jason Merrill wrote:
On Thu, Oct 5, 2017 at 6:31 AM, Martin Liška wrote:
As discussed 2 days ago on IRC with Jakub and Jonathan, C++ standard says that
having a non-return
function with missing return statement is undefined behavior. We've got
-fsanitize=return check f
> Thank you for review, done that.
This has enabled -Wreturn-type for Ada, what we don't want since the warning
is outsmarted by the language, so I have applied this.
2017-11-06 Eric Botcazou
* gcc-interface/misc.c (gnat_post_options): Clear warn_return_type.
--
Eric BotcazouIndex
On Mon, Nov 06, 2017 at 06:23:11PM +0100, Eric Botcazou wrote:
> > Thank you for review, done that.
>
> This has enabled -Wreturn-type for Ada, what we don't want since the warning
> is outsmarted by the language, so I have applied this.
>
>
> 2017-11-06 Eric Botcazou
>
> * gcc-interf
Sorry for being late with my comment. I just spotted this minor
formatting issue. Even though GCC isn't (yet) consistent about
it the keyword "constexpr" should be quoted in the error message
below (and, eventually, in all diagnostic messages). Since the
patch has been committed by now this is
> Hasn't it enabled it also for any other FEs other than C family and Fortran?
> Say jit, brig, go, lto?, ...
Very likely, yes.
> I think better would be to remove the initialization to -1 and revert the
> fortran/options.c change, and instead use in the C family:
> if (!global_options_set.x_wa
On 11/06/2017 06:33 PM, Jakub Jelinek wrote:
> On Mon, Nov 06, 2017 at 06:23:11PM +0100, Eric Botcazou wrote:
>>> Thank you for review, done that.
>>
>> This has enabled -Wreturn-type for Ada, what we don't want since the warning
>> is outsmarted by the language, so I have applied this.
>>
>>
>> 2
This breaks g++.dg/torture/pr64669.C with -O3 on ia64:
$ gcc/xg++ -Bgcc/ ../../gcc/gcc/testsuite/g++.dg/torture/pr64669.C -nostdinc++
-Iia64-suse-linux/libstdc++-v3/include/ia64-suse-linux
-Iia64-suse-linux/libstdc++-v3/include -I../libstdc++-v3/libsupc++
-I../libstdc++-v3/include/backward -I..
On 11/07/2017 06:15 PM, Andreas Schwab wrote:
This breaks g++.dg/torture/pr64669.C with -O3 on ia64:
$ gcc/xg++ -Bgcc/ ../../gcc/gcc/testsuite/g++.dg/torture/pr64669.C -nostdinc++
-Iia64-suse-linux/libstdc++-v3/include/ia64-suse-linux
-Iia64-suse-linux/libstdc++-v3/include -I../libstdc++-v3/li
PING^1
On 11/07/2017 11:08 AM, Martin Liška wrote:
> On 11/06/2017 06:33 PM, Jakub Jelinek wrote:
>> On Mon, Nov 06, 2017 at 06:23:11PM +0100, Eric Botcazou wrote:
Thank you for review, done that.
>>>
>>> This has enabled -Wreturn-type for Ada, what we don't want since the
>>> warning
>>> i
On Tue, Nov 07, 2017 at 11:08:58AM +0100, Martin Liška wrote:
> > Hasn't it enabled it also for any other FEs other than C family and Fortran?
> > Say jit, brig, go, lto?, ...
> > I think better would be to remove the initialization to -1 and revert the
> > fortran/options.c change, and instead use
> But we don't. Wonder if in addition to your patch or instead of it it
> wouldn't be safer (especially for FEs added in the future) to:
>
>/* If we see "return;" in some basic block, then we do reach the end
> without returning a value. */
> - else if (warn_return_type
> + else if (
On 11/15/2017 10:42 AM, Eric Botcazou wrote:
>> But we don't. Wonder if in addition to your patch or instead of it it
>> wouldn't be safer (especially for FEs added in the future) to:
>>
>>/* If we see "return;" in some basic block, then we do reach the end
>> without returning a value.
> Following patch survives regression tests and bootstraps.
Please drop the Ada bits though, -Wreturn-type just doesn't work in Ada.
--
Eric Botcazou
On Wed, Nov 15, 2017 at 10:54:23AM +0100, Martin Liška wrote:
> gcc/c/ChangeLog:
>
> 2017-11-15 Martin Liska
>
> * c-decl.c (grokdeclarator):
> Compare warn_return_type for greater than zero.
> (start_function): Likewise.
> (finish_function): Likewise.
> * c-typec
On 11/15/2017 11:04 AM, Jakub Jelinek wrote:
> On Wed, Nov 15, 2017 at 10:54:23AM +0100, Martin Liška wrote:
>> gcc/c/ChangeLog:
>>
>> 2017-11-15 Martin Liska
>>
>> * c-decl.c (grokdeclarator):
>> Compare warn_return_type for greater than zero.
>> (start_function): Likewise.
>>
Hi!
After r254437 "Instrument function exit with __builtin_unreachable in
C++" (assuming that I bisected that correctly), I'm seeing a number of
C++ "ifunc" test cases regress from PASS to UNSUPPORTED. This is because
of:
ifunc_available29518.c: In function 'void (* g())()':
ifunc_availa
29 matches
Mail list logo