public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/61957] New: Wrong -Warray-bounds warning depending on parameter types
@ 2014-07-29 16:56 tavianator at gmail dot com
  2021-08-08  3:28 ` [Bug middle-end/61957] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: tavianator at gmail dot com @ 2014-07-29 16:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61957
           Summary: Wrong -Warray-bounds warning depending on parameter
                    types
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tavianator at gmail dot com

Created attachment 33205
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33205&action=edit
Test case

On x86-64 Linux, the attached testcase produces the duplicate spurious warning
with -O3 and -Wall:

$ gcc -std=c11 -O3 -Wall -c array-bounds.c
array-bounds.c: In function 'cofactor':
array-bounds.c:9:10: warning: array subscript is above array bounds
[-Warray-bounds]
         n[k] = A[i][j];
          ^
array-bounds.c:9:10: warning: array subscript is above array bounds
[-Warray-bounds]

Interestingly, if the 'row' and 'col' parameters are changed to 'unsigned
long', the warning goes away.


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

* [Bug middle-end/61957] Wrong -Warray-bounds warning depending on parameter types
  2014-07-29 16:56 [Bug c/61957] New: Wrong -Warray-bounds warning depending on parameter types tavianator at gmail dot com
@ 2021-08-08  3:28 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-08  3:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
   Target Milestone|---                         |4.9.3
           Keywords|                            |diagnostic
         Resolution|---                         |FIXED

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So this was fixed by r5-6842 which was backported for GCC 4.9.3 also.

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

end of thread, other threads:[~2021-08-08  3:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-29 16:56 [Bug c/61957] New: Wrong -Warray-bounds warning depending on parameter types tavianator at gmail dot com
2021-08-08  3:28 ` [Bug middle-end/61957] " 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).