public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/104355] New: Misleading -Warray-bounds documentation says "always out of bounds"
@ 2022-02-02 20:44 redi at gcc dot gnu.org
  2022-02-02 21:21 ` [Bug middle-end/104355] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2022-02-02 20:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104355
           Summary: Misleading -Warray-bounds documentation says "always
                    out of bounds"
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: documentation
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

-Warray-bounds
      -Warray-bounds=n
          This option is only active when -ftree-vrp is active
          (default for -O2 and above). It warns about subscripts
          to arrays that are always out of bounds. This warning
          is enabled by -Wall.

It's not true that it warns for "always out of bounds", as that implies no
false positives.

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

* [Bug middle-end/104355] Misleading -Warray-bounds documentation says "always out of bounds"
  2022-02-02 20:44 [Bug middle-end/104355] New: Misleading -Warray-bounds documentation says "always out of bounds" redi at gcc dot gnu.org
@ 2022-02-02 21:21 ` pinskia at gcc dot gnu.org
  2022-02-08 22:17 ` msebor at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-02 21:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-02-02
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

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

* [Bug middle-end/104355] Misleading -Warray-bounds documentation says "always out of bounds"
  2022-02-02 20:44 [Bug middle-end/104355] New: Misleading -Warray-bounds documentation says "always out of bounds" redi at gcc dot gnu.org
  2022-02-02 21:21 ` [Bug middle-end/104355] " pinskia at gcc dot gnu.org
@ 2022-02-08 22:17 ` msebor at gcc dot gnu.org
  2022-02-08 22:17 ` msebor at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: msebor at gcc dot gnu.org @ 2022-02-08 22:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
The documentation is also incorrect about the warning being only active with
-ftree-vrp.  A small subset of -Warray-bounds is issued even without
optimization.  For example the following warning(s) have been issued since GCC
4.1: 

$ cat a.c && gcc -S -Wall a.c
int f (void)
{
  return __builtin_strlen ("123" + 5);
}
a.c: In function ‘f’:
a.c:3:34: warning: offset ‘5’ outside bounds of constant string
[-Warray-bounds]
    3 |   return __builtin_strlen ("123" + 5);
      |                            ~~~~~~^~~
a.c:3:10: warning: offset ‘5’ outside bounds of constant string
[-Warray-bounds]
    3 |   return __builtin_strlen ("123" + 5);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

* [Bug middle-end/104355] Misleading -Warray-bounds documentation says "always out of bounds"
  2022-02-02 20:44 [Bug middle-end/104355] New: Misleading -Warray-bounds documentation says "always out of bounds" redi at gcc dot gnu.org
  2022-02-02 21:21 ` [Bug middle-end/104355] " pinskia at gcc dot gnu.org
  2022-02-08 22:17 ` msebor at gcc dot gnu.org
@ 2022-02-08 22:17 ` msebor at gcc dot gnu.org
  2022-02-11  0:00 ` msebor at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: msebor at gcc dot gnu.org @ 2022-02-08 22:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Let me update the manual.

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

* [Bug middle-end/104355] Misleading -Warray-bounds documentation says "always out of bounds"
  2022-02-02 20:44 [Bug middle-end/104355] New: Misleading -Warray-bounds documentation says "always out of bounds" redi at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-02-08 22:17 ` msebor at gcc dot gnu.org
@ 2022-02-11  0:00 ` msebor at gcc dot gnu.org
  2022-02-14 22:55 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: msebor at gcc dot gnu.org @ 2022-02-11  0:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
Patch: https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590233.html

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

* [Bug middle-end/104355] Misleading -Warray-bounds documentation says "always out of bounds"
  2022-02-02 20:44 [Bug middle-end/104355] New: Misleading -Warray-bounds documentation says "always out of bounds" redi at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-02-11  0:00 ` msebor at gcc dot gnu.org
@ 2022-02-14 22:55 ` cvs-commit at gcc dot gnu.org
  2024-01-19  4:34 ` sandra at gcc dot gnu.org
  2024-01-20 17:18 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-14 22:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Sebor <msebor@gcc.gnu.org>:

https://gcc.gnu.org/g:7a1b179b08bc802280ca90ed4c6c8d8b25503e66

commit r12-7234-g7a1b179b08bc802280ca90ed4c6c8d8b25503e66
Author: Martin Sebor <msebor@redhat.com>
Date:   Mon Feb 14 15:40:25 2022 -0700

    Update -Warray-bounds documentation [PR104355].

    Resolves:
    PR middle-end/104355 - Misleading and outdated -Warray-bounds documentation

    gcc/ChangeLog:
            PR middle-end/104355
            * doc/invoke.texi (-Warray-bounds): Update documentation.

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

* [Bug middle-end/104355] Misleading -Warray-bounds documentation says "always out of bounds"
  2022-02-02 20:44 [Bug middle-end/104355] New: Misleading -Warray-bounds documentation says "always out of bounds" redi at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-02-14 22:55 ` cvs-commit at gcc dot gnu.org
@ 2024-01-19  4:34 ` sandra at gcc dot gnu.org
  2024-01-20 17:18 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: sandra at gcc dot gnu.org @ 2024-01-19  4:34 UTC (permalink / raw)
  To: gcc-bugs

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

sandra at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |sandra at gcc dot gnu.org

--- Comment #6 from sandra at gcc dot gnu.org ---
Looks like this was fixed by Martin's commit 2 years ago, closing now.

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

* [Bug middle-end/104355] Misleading -Warray-bounds documentation says "always out of bounds"
  2022-02-02 20:44 [Bug middle-end/104355] New: Misleading -Warray-bounds documentation says "always out of bounds" redi at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-01-19  4:34 ` sandra at gcc dot gnu.org
@ 2024-01-20 17:18 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-20 17:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

end of thread, other threads:[~2024-01-20 17:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 20:44 [Bug middle-end/104355] New: Misleading -Warray-bounds documentation says "always out of bounds" redi at gcc dot gnu.org
2022-02-02 21:21 ` [Bug middle-end/104355] " pinskia at gcc dot gnu.org
2022-02-08 22:17 ` msebor at gcc dot gnu.org
2022-02-08 22:17 ` msebor at gcc dot gnu.org
2022-02-11  0:00 ` msebor at gcc dot gnu.org
2022-02-14 22:55 ` cvs-commit at gcc dot gnu.org
2024-01-19  4:34 ` sandra at gcc dot gnu.org
2024-01-20 17:18 ` 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).