public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/103751] New: FAIL: gcc.dg/Warray-bounds-48.c (test for excess errors)
@ 2021-12-16 16:25 msebor at gcc dot gnu.org
  2021-12-16 17:48 ` [Bug middle-end/103751] " schwab@linux-m68k.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-12-16 16:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103751
           Summary: FAIL: gcc.dg/Warray-bounds-48.c (test for excess
                    errors)
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

The two tests below show a coupled of failures with the m68k-unknown-linux-gnu
cross:

Running /src/gcc/master/gcc/testsuite/gcc.dg/dg.exp ...
FAIL: gcc.dg/Warray-bounds-48-novec.c (test for excess errors)
FAIL: gcc.dg/Warray-bounds-48.c (test for excess errors)

                === gcc Summary ===

# of expected passes            3555
# of unexpected failures        2
# of expected failures          280
/ssd/build/m68k-unknown-linux-gnu/gcc-master/gcc/xgcc  version 12.0.0 20211215
(experimental) (GCC) 

Excess errors:
/src/gcc/master/gcc/testsuite/gcc.dg/Warray-bounds-48-novec.c:241:50: warning:
array subscript 3 is above array bounds of 'int16_t[1]' {aka 'short int[1]'}
[-Warray-bounds]
/src/gcc/master/gcc/testsuite/gcc.dg/Warray-bounds-48-novec.c:248:64: warning:
array subscript 4 is above array bounds of 'int16_t[1]' {aka 'short int[1]'}
[-Warray-bounds]

Excess errors:
/src/gcc/master/gcc/testsuite/gcc.dg/Warray-bounds-48.c:241:50: warning: array
subscript 3 is above array bounds of 'int16_t[1]' {aka 'short int[1]'}
[-Warray-bounds]
/src/gcc/master/gcc/testsuite/gcc.dg/Warray-bounds-48.c:248:64: warning: array
subscript 4 is above array bounds of 'int16_t[1]' {aka 'short int[1]'}
[-Warray-bounds]

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

* [Bug middle-end/103751] FAIL: gcc.dg/Warray-bounds-48.c (test for excess errors)
  2021-12-16 16:25 [Bug middle-end/103751] New: FAIL: gcc.dg/Warray-bounds-48.c (test for excess errors) msebor at gcc dot gnu.org
@ 2021-12-16 17:48 ` schwab@linux-m68k.org
  2021-12-16 19:29 ` [Bug testsuite/103751] " msebor at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: schwab@linux-m68k.org @ 2021-12-16 17:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> ---
    char buf_p2[sizeof (struct A1) + 2 * sizeof (int16_t)];

This has space for 1 * int32_t and 3 * int16_t, so the warning is correct.

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

* [Bug testsuite/103751] FAIL: gcc.dg/Warray-bounds-48.c (test for excess errors)
  2021-12-16 16:25 [Bug middle-end/103751] New: FAIL: gcc.dg/Warray-bounds-48.c (test for excess errors) msebor at gcc dot gnu.org
  2021-12-16 17:48 ` [Bug middle-end/103751] " schwab@linux-m68k.org
@ 2021-12-16 19:29 ` msebor at gcc dot gnu.org
  2021-12-16 19:34 ` cvs-commit at gcc dot gnu.org
  2021-12-16 19:35 ` msebor at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-12-16 19:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|56456                       |
           Keywords|                            |diagnostic
   Target Milestone|---                         |12.0
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-12-16
             Status|UNCONFIRMED                 |ASSIGNED
          Component|middle-end                  |testsuite
           Assignee|unassigned at gcc dot gnu.org      |msebor at gcc dot gnu.org

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
The reason for the unexpected warnings is that the test assumes that a struct
with just two members, a 32-bit int followed by a 16-bit int, is padded to
64-bits.  That a valid assumption on many but not all targets.  The m68k-*-*
target aligns 32-bit integers on a 16-bit boundary and so it doesn't add any
tail padding to such a struct, so the warnings are valid.  Let me fix the test.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56456
[Bug 56456] [meta-bug] bogus/missing -Warray-bounds

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

* [Bug testsuite/103751] FAIL: gcc.dg/Warray-bounds-48.c (test for excess errors)
  2021-12-16 16:25 [Bug middle-end/103751] New: FAIL: gcc.dg/Warray-bounds-48.c (test for excess errors) msebor at gcc dot gnu.org
  2021-12-16 17:48 ` [Bug middle-end/103751] " schwab@linux-m68k.org
  2021-12-16 19:29 ` [Bug testsuite/103751] " msebor at gcc dot gnu.org
@ 2021-12-16 19:34 ` cvs-commit at gcc dot gnu.org
  2021-12-16 19:35 ` msebor at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-16 19:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:f91814c22595e1db642140efe030caf2c092ab6f

commit r12-6023-gf91814c22595e1db642140efe030caf2c092ab6f
Author: Martin Sebor <msebor@redhat.com>
Date:   Thu Dec 16 12:28:03 2021 -0700

    Fix member alignment for all targets [PR103751].

    Resolves:
    PR testsuite/103751 - FAIL: gcc.dg/Warray-bounds-48.c (test for excess
errors)

    gcc/testsuite/ChangeLog:
            PR testsuite/103751
            * gcc.dg/Warray-bounds-48.c: Fix member alignment.

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

* [Bug testsuite/103751] FAIL: gcc.dg/Warray-bounds-48.c (test for excess errors)
  2021-12-16 16:25 [Bug middle-end/103751] New: FAIL: gcc.dg/Warray-bounds-48.c (test for excess errors) msebor at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-12-16 19:34 ` cvs-commit at gcc dot gnu.org
@ 2021-12-16 19:35 ` msebor at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-12-16 19:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2021-12-16 19:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16 16:25 [Bug middle-end/103751] New: FAIL: gcc.dg/Warray-bounds-48.c (test for excess errors) msebor at gcc dot gnu.org
2021-12-16 17:48 ` [Bug middle-end/103751] " schwab@linux-m68k.org
2021-12-16 19:29 ` [Bug testsuite/103751] " msebor at gcc dot gnu.org
2021-12-16 19:34 ` cvs-commit at gcc dot gnu.org
2021-12-16 19:35 ` msebor 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).