public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/102969] New: [12 regression] g++.dg/warn/Wstringop-overflow-4.C fails after r12-4726
@ 2021-10-27 18:30 seurer at gcc dot gnu.org
  2021-10-27 21:02 ` [Bug tree-optimization/102969] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: seurer at gcc dot gnu.org @ 2021-10-27 18:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102969

            Bug ID: 102969
           Summary: [12 regression] g++.dg/warn/Wstringop-overflow-4.C
                    fails after r12-4726
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

g:9a27acc30a34b7854db32eac562306cebac6fa1e, r12-4726
make  -k check-gcc RUNTESTFLAGS="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

spawn -ignore SIGHUP
/home/seurer/gcc/git/build/gcc-test/gcc/testsuite/g++/../../xg++
-B/home/seurer/gcc/git/build/gcc-test/gcc/testsuite/g++/../../
exceptions_enabled844733.cc -fdiagnostics-plain-output -nostdinc++
-I/home/seurer/gcc/git/build/gcc-test/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/powerpc64le-unknown-linux-gnu
-I/home/seurer/gcc/git/build/gcc-test/powerpc64le-unknown-linux-gnu/libstdc++-v3/include
-I/home/seurer/gcc/git/gcc-test/libstdc++-v3/libsupc++
-I/home/seurer/gcc/git/gcc-test/libstdc++-v3/include/backward
-I/home/seurer/gcc/git/gcc-test/libstdc++-v3/testsuite/util -fmessage-length=0
-S -o exceptions_enabled844733.s
FAIL: g++.dg/warn/Wstringop-overflow-4.C  -std=gnu++98 (test for excess errors)
Excess errors:
/home/seurer/gcc/git/gcc-test/gcc/testsuite/g++.dg/warn/Wstringop-overflow-4.C:164:3:
warning: 'void* __builtin_memcpy(void*, const void*, long unsigned int)'
writing 3 bytes into a region of size 0 overflows the destination
[-Wstringop-overflow=]


commit 9a27acc30a34b7854db32eac562306cebac6fa1e (HEAD, refs/bisect/bad)
Author: Martin Sebor <msebor@redhat.com>
Date:   Tue Oct 26 14:38:11 2021 -0600

    Make full use of context-sensitive ranges in access warnings.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/102969] [12 regression] g++.dg/warn/Wstringop-overflow-4.C fails after r12-4726
  2021-10-27 18:30 [Bug other/102969] New: [12 regression] g++.dg/warn/Wstringop-overflow-4.C fails after r12-4726 seurer at gcc dot gnu.org
@ 2021-10-27 21:02 ` pinskia at gcc dot gnu.org
  2021-10-27 22:00 ` msebor at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-27 21:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102969

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
               Host|powerpc64-linux-gnu,        |
                   |powerpc64le-linux-gnu       |
   Last reconfirmed|                            |2021-10-27
          Component|other                       |tree-optimization
   Target Milestone|---                         |12.0
             Target|powerpc64-linux-gnu,        |powerpc64{,le}-linux-gnu,
                   |powerpc64le-linux-gnu       |aarch64-linux-gnu
           Keywords|                            |diagnostic
              Build|powerpc64-linux-gnu,        |
                   |powerpc64le-linux-gnu       |

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. I noticed this too.
I debugged it a little bit too. The reason why it shows up in C++98 only is
because C++98 does the size check slightly different and does not throw an
exception in the case of an overflow.
Also You need all 3 checks in the code to get the warning in the first place,
that is:
  ptrdiff_t r_dmin_dmax = SR (DIFF_MIN, DIFF_MAX);
  T (S (1), new int16_t[r_dmin_dmax]);
  T (S (2), new int16_t[r_dmin_dmax + 1]);
  T (S (9), new int16_t[r_dmin_dmax * 2 + 1]);

Have just the one which warns does not cause a warning.  I didn't look further
than that.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/102969] [12 regression] g++.dg/warn/Wstringop-overflow-4.C fails after r12-4726
  2021-10-27 18:30 [Bug other/102969] New: [12 regression] g++.dg/warn/Wstringop-overflow-4.C fails after r12-4726 seurer at gcc dot gnu.org
  2021-10-27 21:02 ` [Bug tree-optimization/102969] " pinskia at gcc dot gnu.org
@ 2021-10-27 22:00 ` msebor at gcc dot gnu.org
  2021-11-11 23:31 ` msebor at gcc dot gnu.org
  2021-11-11 23:38 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-10-27 22:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102969

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
             Blocks|                            |88443
           Assignee|unassigned at gcc dot gnu.org      |msebor at gcc dot gnu.org


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443
[Bug 88443] [meta-bug] bogus/missing -Wstringop-overflow warnings

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/102969] [12 regression] g++.dg/warn/Wstringop-overflow-4.C fails after r12-4726
  2021-10-27 18:30 [Bug other/102969] New: [12 regression] g++.dg/warn/Wstringop-overflow-4.C fails after r12-4726 seurer at gcc dot gnu.org
  2021-10-27 21:02 ` [Bug tree-optimization/102969] " pinskia at gcc dot gnu.org
  2021-10-27 22:00 ` msebor at gcc dot gnu.org
@ 2021-11-11 23:31 ` msebor at gcc dot gnu.org
  2021-11-11 23:38 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-11-11 23:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102969

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Looks like this has resolved itself, most likely by one of the changes to make
greater use of ranger.  I can't reproduce it with a cross-compiler and don't
see the failures in recent test results.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/102969] [12 regression] g++.dg/warn/Wstringop-overflow-4.C fails after r12-4726
  2021-10-27 18:30 [Bug other/102969] New: [12 regression] g++.dg/warn/Wstringop-overflow-4.C fails after r12-4726 seurer at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-11-11 23:31 ` msebor at gcc dot gnu.org
@ 2021-11-11 23:38 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-11 23:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102969

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #2)
> Looks like this has resolved itself, most likely by one of the changes to
> make greater use of ranger.  I can't reproduce it with a cross-compiler and
> don't see the failures in recent test results.

It was fixed sometime before r12-4939.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-11 23:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27 18:30 [Bug other/102969] New: [12 regression] g++.dg/warn/Wstringop-overflow-4.C fails after r12-4726 seurer at gcc dot gnu.org
2021-10-27 21:02 ` [Bug tree-optimization/102969] " pinskia at gcc dot gnu.org
2021-10-27 22:00 ` msebor at gcc dot gnu.org
2021-11-11 23:31 ` msebor at gcc dot gnu.org
2021-11-11 23:38 ` pinskia at gcc dot gnu.org

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).