Bug 106120 - [13 regression] g++.dg/warn/Wstringop-overflow-4.C fails since r13-1268-g8c99e307b20c50
Summary: [13 regression] g++.dg/warn/Wstringop-overflow-4.C fails since r13-1268-g8c99...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 13.0
: P1 normal
Target Milestone: 13.0
Assignee: Not yet assigned to anyone
URL: https://gcc.gnu.org/pipermail/gcc-pat...
Keywords: diagnostic, patch, testsuite-fail
Depends on:
Blocks: Wstringop-overflow
  Show dependency treegraph
 
Reported: 2022-06-28 16:01 UTC by seurer
Modified: 2023-11-23 00:29 UTC (History)
6 users (show)

See Also:
Host: powerpc64-linux-gnu hppa-unknown-linux-gnu
Target: powerpc64-linux-gnu hppa-unknown-linux-gnu
Build: powerpc64-linux-gnu hppa-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2023-01-30 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description seurer 2022-06-28 16:01:59 UTC
g:8c99e307b20c502e55c425897fb3884ba8f05882, r13-1268-g8c99e307b20c50
make  -k check-gcc RUNTESTFLAGS="--target_board=unix'{-m32}' dg.exp=g++.dg/warn/Wstringop-overflow-4.C"
FAIL: g++.dg/warn/Wstringop-overflow-4.C  -std=gnu++98 (test for excess errors)
# of expected passes		59
# of unexpected failures	1


This is for 32 bits on a powerpc64 BE system.


Excess errors:
/home/seurer/gcc/git/gcc-trunk/gcc/testsuite/g++.dg/warn/Wstringop-overflow-4.C:144:3: warning: 'void* __builtin_memcpy(void*, const void*, unsigned int)' writing 3 bytes into a region of size 0 [-Wstringop-overflow=]


commit 8c99e307b20c502e55c425897fb3884ba8f05882
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Sat Jun 25 18:58:02 2022 -0400

    Convert DOM to use Ranger rather than EVRP
Comment 1 Aldy Hernandez 2022-06-28 17:25:01 UTC
I wonder if this is the same problem we see on x86-64 on line 198.
Comment 2 seurer 2022-06-28 18:14:37 UTC
I am not sure.  This only happens for 32 bit runs on power.  64 bit ones work fine.
Comment 3 Hans-Peter Nilsson 2022-06-29 00:03:20 UTC
(In reply to seurer from comment #2)
> I am not sure.  This only happens for 32 bit runs on power.  64 bit ones
> work fine.

You mean something like -m32 with powerpc64-linux-gnu?

I'll dump my observations for cris-elf (a "32-bit target") hoping it'll help:
At r13-1268-g8c99e307b20c50:

Running TOPLEVEL/gcc/testsuite/g++.dg/dg.exp ...
...
FAIL: g++.dg/warn/Wstringop-overflow-4.C  -std=gnu++98 (test for excess errors)
...

At r13-1333-g74956337e827, (long) after r13-1271-g80ace9185dc534 aldyh@redhat.com "XFAIL a test in g++.dg/warn/Wstringop-overflow-4.C":

Running TOPLEVEL/gcc/testsuite/g++.dg/dg.exp ...
FAIL: g++.dg/warn/Wstringop-overflow-4.C  -std=gnu++98 (test for excess errors)
XPASS: g++.dg/warn/Wstringop-overflow-4.C  -std=gnu++14  (test for bogus messages, line 198)
XPASS: g++.dg/warn/Wstringop-overflow-4.C  -std=gnu++17  (test for bogus messages, line 198)
XPASS: g++.dg/warn/Wstringop-overflow-4.C  -std=gnu++20  (test for bogus messages, line 198)

g++.log at that latter commit:
FAIL: g++.dg/warn/Wstringop-overflow-4.C  -std=gnu++98 (test for excess errors)
Excess errors:
TOPLEVEL/gcc/testsuite/g++.dg/warn/Wstringop-overflow-4.C:144:3: warning: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' writing 3 bytes into a region of size 0 [-Wstringop-overflow=]
Comment 4 Hans-Peter Nilsson 2022-07-08 23:10:12 UTC
The XPASS:es seem to be the same for everyone, with the FAIL only appearing on ILP32.

Aldy, how about correcting those xfail markers and adding one for ILP32?
Comment 5 Aldy Hernandez 2022-07-09 06:29:19 UTC
(In reply to Hans-Peter Nilsson from comment #4)
> The XPASS:es seem to be the same for everyone, with the FAIL only appearing
> on ILP32.
> 
> Aldy, how about correcting those xfail markers and adding one for ILP32?

Sounds fine to me.  I won't be able to get to it until next week, so if you want to whip up a patch and CC me, I'd be glad to approve it.
Comment 6 GCC Commits 2023-02-10 00:41:55 UTC
The master branch has been updated by Hans-Peter Nilsson <hp@gcc.gnu.org>:

https://gcc.gnu.org/g:c47f76c16bf7b3108e762d4b8b16fbb0c9c75187

commit r13-5765-gc47f76c16bf7b3108e762d4b8b16fbb0c9c75187
Author: Hans-Peter Nilsson <hp@axis.com>
Date:   Tue Feb 7 17:28:50 2023 +0100

    testsuite: XFAIL bogus g++.dg/warn/Wstringop-overflow-4.C:144, PR106120
    
    There was a commit r13-2082-gbf13a13c65bd06 "c++: remove some xfails"
    (not referencing the PR) that dealt with part of the PR, but didn't
    xfail the ilp32-specific (bogus) warning mentioned in the PR.
    
            PR testsuite/106120
            * g++.dg/warn/Wstringop-overflow-4.C:144 XFAIL bogus warning for
            ilp32 targets with c++98.
Comment 7 Hans-Peter Nilsson 2023-02-10 18:34:36 UTC
Can the reporter please affirm that the issue is now solved (ppc64 m32 BE)?
It is for cris-elf, but it wouldn't be right closing someone elses bug-report.
Comment 8 seurer 2023-02-10 18:37:39 UTC
Yes, in the test run I just did it worked.
Comment 9 Hans-Peter Nilsson 2023-02-10 22:52:50 UTC
(In reply to seurer from comment #8)
> Yes, in the test run I just did it worked.

Ok, as this PR was "testsuite" as opposed to an underlying issue, I'm closing this.
Comment 10 Rainer Orth 2023-11-21 15:21:02 UTC
Since 20230106, this test produces an XPASS, according to gcc-testresults
postings this happens everywhere:

+XPASS: g++.dg/warn/Wstringop-overflow-4.C  -std=gnu++98 pr106120 (test for bogus messages, line 144)

The corresponding line is

  T (S (2), new int16_t[r_imin_imax + 1]); // { dg-bogus "into a region of size" "pr106120" { xfail { c++98_only } } }

I think that xfail should just be removed?
Comment 11 Hans-Peter Nilsson 2023-11-21 17:54:48 UTC
(In reply to Rainer Orth from comment #10)
> Since 20230106, this test produces an XPASS, according to gcc-testresults
> postings this happens everywhere:
> 
> +XPASS: g++.dg/warn/Wstringop-overflow-4.C  -std=gnu++98 pr106120 (test for
> bogus messages, line 144)
> 
> The corresponding line is
> 
>   T (S (2), new int16_t[r_imin_imax + 1]); // { dg-bogus "into a region of
> size" "pr106120" { xfail { c++98_only } } }
> 
> I think that xfail should just be removed?

Yes, though I think the date 20230106 is wrong (at least regarding the "everywhere") and maybe a typo for 20231006, at least according to my own logs - where I unsurprisingly don't track XPASS.  Gotta fix that.
Comment 12 ro@CeBiTec.Uni-Bielefeld.DE 2023-11-22 09:09:24 UTC
> --- Comment #11 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
> (In reply to Rainer Orth from comment #10)
>> Since 20230106, this test produces an XPASS, according to gcc-testresults
>> postings this happens everywhere:
>> 
>> +XPASS: g++.dg/warn/Wstringop-overflow-4.C  -std=gnu++98 pr106120 (test for
>> bogus messages, line 144)
>> 
>> The corresponding line is
>> 
>>   T (S (2), new int16_t[r_imin_imax + 1]); // { dg-bogus "into a region of
>> size" "pr106120" { xfail { c++98_only } } }
>> 
>> I think that xfail should just be removed?
>
> Yes, though I think the date 20230106 is wrong (at least regarding the
> "everywhere") and maybe a typo for 20231006, at least according to my own logs
> - where I unsurprisingly don't track XPASS.  Gotta fix that.

Actually, it's 20231106, I just cannot type.  The XPASSes are included
in the make mail-report.log output, so I have them archived for my
targets.

Thanks for fixing this.
Comment 13 GCC Commits 2023-11-23 00:29:57 UTC
The master branch has been updated by Hans-Peter Nilsson <hp@gcc.gnu.org>:

https://gcc.gnu.org/g:e935151bad1c2a02dc6a31fce3cc21b17d616243

commit r14-5767-ge935151bad1c2a02dc6a31fce3cc21b17d616243
Author: Hans-Peter Nilsson <hp@axis.com>
Date:   Wed Nov 22 02:54:29 2023 +0100

    testsuite: Tweak xfail bogus g++.dg/warn/Wstringop-overflow-4.C:144, PR106120
    
    The conditions under which this this bogus warning is
    emitted has changed to not happen for 32-bit targets
    anymore.  Adjust accordingly.
    
            PR testsuite/106120
            * g++.dg/warn/Wstringop-overflow-4.C:144 XFAIL bogus warning for
            lp64 targets with c++98.