Re: Ping: [PATCH] Fix PR112419
On 11/30/23 10:27, Hans-Peter Nilsson wrote: My plan was to split up the test case in one which is for -Wstringop-overflow and one which is for -Wnonnull and then one could turn off the -Wstringop-overflow for the tests which are actually for -Wnonnull. But adding the dg-blah would certainly be simpler. Sort-of-mid-week ping (only because status quo isn't clear): Jeff, are you content with Martin U:s reply (i.e. patch ok) or are you waiting for a follow-up? Perhaps it's already in your overflowing queue, then please ignore this, I'll just ping in a week. ;-) IMHO, after looking at the test-case I'd expect *more* warnings for ilp32 targets; i.e. it was a bug that it didn't show up before. Sorry, not waiting on anything. Just crazy busy with some personal stuff. I think we can go with the patch as-is. Jeff
Re: Ping: [PATCH] Fix PR112419
> From: Martin Uecker > Cc: richard.guent...@gmail.com > Am Montag, dem 27.11.2023 um 08:36 -0700 schrieb Jeff Law: > > > > On 11/23/23 10:05, Hans-Peter Nilsson wrote: > > > > From: Hans-Peter Nilsson > > > > Date: Thu, 16 Nov 2023 05:24:06 +0100 > > > > > > > > > From: Martin Uecker > > > > > Date: Tue, 07 Nov 2023 06:56:25 +0100 > > > > > > > > > Am Montag, dem 06.11.2023 um 21:01 -0700 schrieb Jeff Law: > > > > > > > > > > > > On 11/6/23 20:58, Hans-Peter Nilsson wrote: > > > > > > > This patch caused a testsuite regression: there's now an > > > > > > > "excess error" failure for gcc.dg/Wnonnull-4.c for 32-bit > > > > > > > targets (and 64-bit targets testing with a "-m32" option) > > > > > > > after your r14-5115-g6e9ee44d96e5. It's logged as PR112419. > > > > > > It caused failures for just about every target ;( Presumably it > > > > > > worked > > > > > > on x86_64... > > > > > > > > > > I do not think this is a true regression > > > > > just a problem with the test on 32-bit which somehow surfaced > > > > > due to the change. > > > > > > > > > > The excess error is: > > > > > > > > > > FAIL: gcc.dg/Wnonnull-4.c (test for excess errors) > > > > > Excess errors: > > > > > /home/tcwg-buildslave/workspace/tcwg_gnu_6/abe/snapshots/gcc.git~master/gcc/testsuite/gcc.dg/Wnonnull-4.c:144:3: > > > > > warning: 'fda_n_5' specified size 4294967256 exceeds maximum object > > > > > size > > > > > 2147483647 [-Wstringop-overflow=] > > > > > > > > > > I think the warning was suppressed before due to the other (nonnull) > > > > > warning which I removed in this case. > > > > > > > > > > I think the simple fix might be to to turn off -Wstringop-overflow. > > > > > > > > No, that trigs many of the dg-warnings that are tested. > > > > > > > > (I didn't pay attention to the actual warning messages and > > > > tried to pursue that at first.) > > > > > > > > Maybe think it's best to actually expect the warning, like > > > > so. > > > > > > > > Maintainers of 16-bit targets will have to address their > > > > concerns separately. For example, they may choose to not > > > > run the test at all. > > > > > > > > Ok to commit? > > > > > > > > Subject: [PATCH] gcc.dg/Wnonnull-4.c: Handle new overflow warning for > > > > 32-bit targets [PR112419] > > > > > > > > PR testsuite/112419 > > > > * gcc.dg/Wnonnull-4.c (test_fda_n_5): Expect warning for > > > > exceeding > > > > maximum object size for 32-bit targets. > > > > --- > > > > gcc/testsuite/gcc.dg/Wnonnull-4.c | 1 + > > > > 1 file changed, 1 insertion(+) > > > > > > > > diff --git a/gcc/testsuite/gcc.dg/Wnonnull-4.c > > > > b/gcc/testsuite/gcc.dg/Wnonnull-4.c > > > > index 1f14fbba45df..d63e76da70a2 100644 > > > > --- a/gcc/testsuite/gcc.dg/Wnonnull-4.c > > > > +++ b/gcc/testsuite/gcc.dg/Wnonnull-4.c > > > > @@ -142,6 +142,7 @@ void test_fda_n_5 (int r_m1) > > > > T ( 1); // { dg-bogus "argument 2 of variable length > > > > array 'double\\\[n]\\\[5]' is null but the corresponding bound argument > > > > 1 value is 1" } > > > > T ( 9); // { dg-bogus "argument 2 of variable length > > > > array 'double\\\[n]\\\[5]' is null but the corresponding bound argument > > > > 1 value is 9" } > > > > T (max); // { dg-bogus "argument 2 of variable length > > > > array 'double\\\[n]\\\[5]' is null but the corresponding bound argument > > > > 1 value is \\d+" } > > > > +// { dg-warning "size 4294967256 exceeds maximum object size" "" { > > > > target ilp32 } .-1 } > > > > } > > Unfortunately I think we need to go back to the original issue that > > Martin (I think) dismissed. > > > > Specifically, this is a regression. It's very clear that prior to the > > patch in question there was no diagnostic about the size of the > > requested memory allocation and after the patch in question we get the > > "exceeds maximum object size" diagnostic. > > > > Now one explanation could be that the diagnostic is warranted and it was > > a bug that the diagnostic hadn't been emitted prior to Martin's patch. > > In this case some kind of dg-blah is warranted, but I don't think anyone > > has made this argument. > > > I believe the warning is correct but was suppressed before. > > > My plan was to split up the test case in one which is for > -Wstringop-overflow and one which is for -Wnonnull and then > one could turn off the -Wstringop-overflow for the tests > which are actually for -Wnonnull. But adding the dg-blah > would certainly be simpler. Sort-of-mid-week ping (only because status quo isn't clear): Jeff, are you content with Martin U:s reply (i.e. patch ok) or are you waiting for a follow-up? Perhaps it's already in your overflowing queue, then please ignore this, I'll just ping in a week. ;-) IMHO, after looking at the test-case I'd expect *more* warnings for ilp32 targets; i.e. it was a bug that it didn't show up before. brgds, H-P
Re: Ping: [PATCH] Fix PR112419
Am Montag, dem 27.11.2023 um 16:54 +0100 schrieb Martin Uecker: > Am Montag, dem 27.11.2023 um 08:36 -0700 schrieb Jeff Law: > > > > On 11/23/23 10:05, Hans-Peter Nilsson wrote: > > > > From: Hans-Peter Nilsson > > > > Date: Thu, 16 Nov 2023 05:24:06 +0100 > > > > > > > > > From: Martin Uecker > > > > > Date: Tue, 07 Nov 2023 06:56:25 +0100 > > > > > > > > > Am Montag, dem 06.11.2023 um 21:01 -0700 schrieb Jeff Law: > > > > > > > > > > > > On 11/6/23 20:58, Hans-Peter Nilsson wrote: > > > > > > > This patch caused a testsuite regression: there's now an > > > > > > > "excess error" failure for gcc.dg/Wnonnull-4.c for 32-bit > > > > > > > targets (and 64-bit targets testing with a "-m32" option) > > > > > > > after your r14-5115-g6e9ee44d96e5. It's logged as PR112419. > > > > > > It caused failures for just about every target ;( Presumably it > > > > > > worked > > > > > > on x86_64... > > > > > > > > > > I do not think this is a true regression > > > > > just a problem with the test on 32-bit which somehow surfaced > > > > > due to the change. > > > > > > > > > > The excess error is: > > > > > > > > > > FAIL: gcc.dg/Wnonnull-4.c (test for excess errors) > > > > > Excess errors: > > > > > /home/tcwg-buildslave/workspace/tcwg_gnu_6/abe/snapshots/gcc.git~master/gcc/testsuite/gcc.dg/Wnonnull-4.c:144:3: > > > > > warning: 'fda_n_5' specified size 4294967256 exceeds maximum object > > > > > size > > > > > 2147483647 [-Wstringop-overflow=] > > > > > > > > > > I think the warning was suppressed before due to the other (nonnull) > > > > > warning which I removed in this case. > > > > > > > > > > I think the simple fix might be to to turn off -Wstringop-overflow. > > > > > > > > No, that trigs many of the dg-warnings that are tested. > > > > > > > > (I didn't pay attention to the actual warning messages and > > > > tried to pursue that at first.) > > > > > > > > Maybe think it's best to actually expect the warning, like > > > > so. > > > > > > > > Maintainers of 16-bit targets will have to address their > > > > concerns separately. For example, they may choose to not > > > > run the test at all. > > > > > > > > Ok to commit? > > > > > > > > Subject: [PATCH] gcc.dg/Wnonnull-4.c: Handle new overflow warning for > > > > 32-bit targets [PR112419] > > > > > > > > PR testsuite/112419 > > > > * gcc.dg/Wnonnull-4.c (test_fda_n_5): Expect warning for > > > > exceeding > > > > maximum object size for 32-bit targets. > > > > --- > > > > gcc/testsuite/gcc.dg/Wnonnull-4.c | 1 + > > > > 1 file changed, 1 insertion(+) > > > > > > > > diff --git a/gcc/testsuite/gcc.dg/Wnonnull-4.c > > > > b/gcc/testsuite/gcc.dg/Wnonnull-4.c > > > > index 1f14fbba45df..d63e76da70a2 100644 > > > > --- a/gcc/testsuite/gcc.dg/Wnonnull-4.c > > > > +++ b/gcc/testsuite/gcc.dg/Wnonnull-4.c > > > > @@ -142,6 +142,7 @@ void test_fda_n_5 (int r_m1) > > > > T ( 1); // { dg-bogus "argument 2 of variable length > > > > array 'double\\\[n]\\\[5]' is null but the corresponding bound argument > > > > 1 value is 1" } > > > > T ( 9); // { dg-bogus "argument 2 of variable length > > > > array 'double\\\[n]\\\[5]' is null but the corresponding bound argument > > > > 1 value is 9" } > > > > T (max); // { dg-bogus "argument 2 of variable length > > > > array 'double\\\[n]\\\[5]' is null but the corresponding bound argument > > > > 1 value is \\d+" } > > > > +// { dg-warning "size 4294967256 exceeds maximum object size" "" { > > > > target ilp32 } .-1 } > > > > } > > Unfortunately I think we need to go back to the original issue that > > Martin (I think) dismissed. > > > > Specifically, this is a regression. It's very clear that prior to the > > patch in question there was no diagnostic about the size of the > > requested memory allocation and after the patch in question we get the > > "exceeds maximum object size" diagnostic. > > > > Now one explanation could be that the diagnostic is warranted and it was > > a bug that the diagnostic hadn't been emitted prior to Martin's patch. > > In this case some kind of dg-blah is warranted, but I don't think anyone > > has made this argument. > > > I believe the warning is correct but was suppressed before. > > > My plan was to split up the test case in one which is for > -Wstringop-overflow and one which is for -Wnonnull and then > one could turn off the -Wstringop-overflow for the tests > which are actually for -Wnonnull. But adding the dg-blah > would certainly be simpler. Specifically, also with 13.2 if you suppress the warning which I removed with -Wno-nonnull you will get the otherwise hidden -Wstringop-overflow warning with -m32: See here: https://godbolt.org/z/ev5GhMonq The warning also seems correct to me, so I suggest to accept the proposed patch. Martin
Re: Ping: [PATCH] Fix PR112419
Am Montag, dem 27.11.2023 um 08:36 -0700 schrieb Jeff Law: > > On 11/23/23 10:05, Hans-Peter Nilsson wrote: > > > From: Hans-Peter Nilsson > > > Date: Thu, 16 Nov 2023 05:24:06 +0100 > > > > > > > From: Martin Uecker > > > > Date: Tue, 07 Nov 2023 06:56:25 +0100 > > > > > > > Am Montag, dem 06.11.2023 um 21:01 -0700 schrieb Jeff Law: > > > > > > > > > > On 11/6/23 20:58, Hans-Peter Nilsson wrote: > > > > > > This patch caused a testsuite regression: there's now an > > > > > > "excess error" failure for gcc.dg/Wnonnull-4.c for 32-bit > > > > > > targets (and 64-bit targets testing with a "-m32" option) > > > > > > after your r14-5115-g6e9ee44d96e5. It's logged as PR112419. > > > > > It caused failures for just about every target ;( Presumably it > > > > > worked > > > > > on x86_64... > > > > > > > > I do not think this is a true regression > > > > just a problem with the test on 32-bit which somehow surfaced > > > > due to the change. > > > > > > > > The excess error is: > > > > > > > > FAIL: gcc.dg/Wnonnull-4.c (test for excess errors) > > > > Excess errors: > > > > /home/tcwg-buildslave/workspace/tcwg_gnu_6/abe/snapshots/gcc.git~master/gcc/testsuite/gcc.dg/Wnonnull-4.c:144:3: > > > > warning: 'fda_n_5' specified size 4294967256 exceeds maximum object > > > > size > > > > 2147483647 [-Wstringop-overflow=] > > > > > > > > I think the warning was suppressed before due to the other (nonnull) > > > > warning which I removed in this case. > > > > > > > > I think the simple fix might be to to turn off -Wstringop-overflow. > > > > > > No, that trigs many of the dg-warnings that are tested. > > > > > > (I didn't pay attention to the actual warning messages and > > > tried to pursue that at first.) > > > > > > Maybe think it's best to actually expect the warning, like > > > so. > > > > > > Maintainers of 16-bit targets will have to address their > > > concerns separately. For example, they may choose to not > > > run the test at all. > > > > > > Ok to commit? > > > > > > Subject: [PATCH] gcc.dg/Wnonnull-4.c: Handle new overflow warning for > > > 32-bit targets [PR112419] > > > > > > PR testsuite/112419 > > > * gcc.dg/Wnonnull-4.c (test_fda_n_5): Expect warning for exceeding > > > maximum object size for 32-bit targets. > > > --- > > > gcc/testsuite/gcc.dg/Wnonnull-4.c | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/gcc/testsuite/gcc.dg/Wnonnull-4.c > > > b/gcc/testsuite/gcc.dg/Wnonnull-4.c > > > index 1f14fbba45df..d63e76da70a2 100644 > > > --- a/gcc/testsuite/gcc.dg/Wnonnull-4.c > > > +++ b/gcc/testsuite/gcc.dg/Wnonnull-4.c > > > @@ -142,6 +142,7 @@ void test_fda_n_5 (int r_m1) > > > T ( 1); // { dg-bogus "argument 2 of variable length array > > > 'double\\\[n]\\\[5]' is null but the corresponding bound argument 1 value > > > is 1" } > > > T ( 9); // { dg-bogus "argument 2 of variable length array > > > 'double\\\[n]\\\[5]' is null but the corresponding bound argument 1 value > > > is 9" } > > > T (max); // { dg-bogus "argument 2 of variable length array > > > 'double\\\[n]\\\[5]' is null but the corresponding bound argument 1 value > > > is \\d+" } > > > +// { dg-warning "size 4294967256 exceeds maximum object size" "" { > > > target ilp32 } .-1 } > > > } > Unfortunately I think we need to go back to the original issue that > Martin (I think) dismissed. > > Specifically, this is a regression. It's very clear that prior to the > patch in question there was no diagnostic about the size of the > requested memory allocation and after the patch in question we get the > "exceeds maximum object size" diagnostic. > > Now one explanation could be that the diagnostic is warranted and it was > a bug that the diagnostic hadn't been emitted prior to Martin's patch. > In this case some kind of dg-blah is warranted, but I don't think anyone > has made this argument. > I believe the warning is correct but was suppressed before. My plan was to split up the test case in one which is for -Wstringop-overflow and one which is for -Wnonnull and then one could turn off the -Wstringop-overflow for the tests which are actually for -Wnonnull. But adding the dg-blah would certainly be simpler. Martin
Re: Ping: [PATCH] Fix PR112419
On 11/23/23 10:05, Hans-Peter Nilsson wrote: From: Hans-Peter Nilsson Date: Thu, 16 Nov 2023 05:24:06 +0100 From: Martin Uecker Date: Tue, 07 Nov 2023 06:56:25 +0100 Am Montag, dem 06.11.2023 um 21:01 -0700 schrieb Jeff Law: On 11/6/23 20:58, Hans-Peter Nilsson wrote: This patch caused a testsuite regression: there's now an "excess error" failure for gcc.dg/Wnonnull-4.c for 32-bit targets (and 64-bit targets testing with a "-m32" option) after your r14-5115-g6e9ee44d96e5. It's logged as PR112419. It caused failures for just about every target ;( Presumably it worked on x86_64... I do not think this is a true regression just a problem with the test on 32-bit which somehow surfaced due to the change. The excess error is: FAIL: gcc.dg/Wnonnull-4.c (test for excess errors) Excess errors: /home/tcwg-buildslave/workspace/tcwg_gnu_6/abe/snapshots/gcc.git~master/gcc/testsuite/gcc.dg/Wnonnull-4.c:144:3: warning: 'fda_n_5' specified size 4294967256 exceeds maximum object size 2147483647 [-Wstringop-overflow=] I think the warning was suppressed before due to the other (nonnull) warning which I removed in this case. I think the simple fix might be to to turn off -Wstringop-overflow. No, that trigs many of the dg-warnings that are tested. (I didn't pay attention to the actual warning messages and tried to pursue that at first.) Maybe think it's best to actually expect the warning, like so. Maintainers of 16-bit targets will have to address their concerns separately. For example, they may choose to not run the test at all. Ok to commit? Subject: [PATCH] gcc.dg/Wnonnull-4.c: Handle new overflow warning for 32-bit targets [PR112419] PR testsuite/112419 * gcc.dg/Wnonnull-4.c (test_fda_n_5): Expect warning for exceeding maximum object size for 32-bit targets. --- gcc/testsuite/gcc.dg/Wnonnull-4.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/testsuite/gcc.dg/Wnonnull-4.c b/gcc/testsuite/gcc.dg/Wnonnull-4.c index 1f14fbba45df..d63e76da70a2 100644 --- a/gcc/testsuite/gcc.dg/Wnonnull-4.c +++ b/gcc/testsuite/gcc.dg/Wnonnull-4.c @@ -142,6 +142,7 @@ void test_fda_n_5 (int r_m1) T ( 1); // { dg-bogus "argument 2 of variable length array 'double\\\[n]\\\[5]' is null but the corresponding bound argument 1 value is 1" } T ( 9); // { dg-bogus "argument 2 of variable length array 'double\\\[n]\\\[5]' is null but the corresponding bound argument 1 value is 9" } T (max); // { dg-bogus "argument 2 of variable length array 'double\\\[n]\\\[5]' is null but the corresponding bound argument 1 value is \\d+" } +// { dg-warning "size 4294967256 exceeds maximum object size" "" { target ilp32 } .-1 } } Unfortunately I think we need to go back to the original issue that Martin (I think) dismissed. Specifically, this is a regression. It's very clear that prior to the patch in question there was no diagnostic about the size of the requested memory allocation and after the patch in question we get the "exceeds maximum object size" diagnostic. Now one explanation could be that the diagnostic is warranted and it was a bug that the diagnostic hadn't been emitted prior to Martin's patch. In this case some kind of dg-blah is warranted, but I don't think anyone has made this argument. Jeff
Ping: [PATCH] Fix PR112419 (was: [PATCH] Reduce false positives for -Wnonnull for VLA parameters [PR98541])
> From: Hans-Peter Nilsson > Date: Thu, 16 Nov 2023 05:24:06 +0100 > > > From: Martin Uecker > > Date: Tue, 07 Nov 2023 06:56:25 +0100 > > > Am Montag, dem 06.11.2023 um 21:01 -0700 schrieb Jeff Law: > > > > > > On 11/6/23 20:58, Hans-Peter Nilsson wrote: > > > > This patch caused a testsuite regression: there's now an > > > > "excess error" failure for gcc.dg/Wnonnull-4.c for 32-bit > > > > targets (and 64-bit targets testing with a "-m32" option) > > > > after your r14-5115-g6e9ee44d96e5. It's logged as PR112419. > > > It caused failures for just about every target ;( Presumably it worked > > > on x86_64... > > > > I do not think this is a true regression > > just a problem with the test on 32-bit which somehow surfaced > > due to the change. > > > > The excess error is: > > > > FAIL: gcc.dg/Wnonnull-4.c (test for excess errors) > > Excess errors: > > /home/tcwg-buildslave/workspace/tcwg_gnu_6/abe/snapshots/gcc.git~master/gcc/testsuite/gcc.dg/Wnonnull-4.c:144:3: > > warning: 'fda_n_5' specified size 4294967256 exceeds maximum object size > > 2147483647 [-Wstringop-overflow=] > > > > I think the warning was suppressed before due to the other (nonnull) > > warning which I removed in this case. > > > > I think the simple fix might be to to turn off -Wstringop-overflow. > > No, that trigs many of the dg-warnings that are tested. > > (I didn't pay attention to the actual warning messages and > tried to pursue that at first.) > > Maybe think it's best to actually expect the warning, like > so. > > Maintainers of 16-bit targets will have to address their > concerns separately. For example, they may choose to not > run the test at all. > > Ok to commit? > > Subject: [PATCH] gcc.dg/Wnonnull-4.c: Handle new overflow warning for 32-bit > targets [PR112419] > > PR testsuite/112419 > * gcc.dg/Wnonnull-4.c (test_fda_n_5): Expect warning for exceeding > maximum object size for 32-bit targets. > --- > gcc/testsuite/gcc.dg/Wnonnull-4.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/gcc/testsuite/gcc.dg/Wnonnull-4.c > b/gcc/testsuite/gcc.dg/Wnonnull-4.c > index 1f14fbba45df..d63e76da70a2 100644 > --- a/gcc/testsuite/gcc.dg/Wnonnull-4.c > +++ b/gcc/testsuite/gcc.dg/Wnonnull-4.c > @@ -142,6 +142,7 @@ void test_fda_n_5 (int r_m1) >T ( 1); // { dg-bogus "argument 2 of variable length array > 'double\\\[n]\\\[5]' is null but the corresponding bound argument 1 value is > 1" } >T ( 9); // { dg-bogus "argument 2 of variable length array > 'double\\\[n]\\\[5]' is null but the corresponding bound argument 1 value is > 9" } >T (max); // { dg-bogus "argument 2 of variable length array > 'double\\\[n]\\\[5]' is null but the corresponding bound argument 1 value is > \\d+" } > +// { dg-warning "size 4294967256 exceeds maximum object size" "" { target > ilp32 } .-1 } > } > > > -- > 2.30.2 >