public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/111329] New: [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4
@ 2023-09-07 18:39 seurer at gcc dot gnu.org
  2023-09-07 18:53 ` [Bug other/111329] " jakub at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: seurer at gcc dot gnu.org @ 2023-09-07 18:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111329
           Summary: [14 regression]
                    gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails
                    after r14-3745-g4f4fa2501186e4
           Product: gcc
           Version: 14.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:4f4fa2501186e43d115238ae938b3df322c9e02a, r14-3745-g4f4fa2501186e4
make  -k check-gcc
RUNTESTFLAGS="analyzer.exp=gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c"
FAIL: gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c expected multiline
pattern lines 17-39
FAIL: gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c 2 blank line(s) in output
FAIL: gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c (test for excess errors)
# of expected passes            2
# of unexpected failures        3

commit 4f4fa2501186e43d115238ae938b3df322c9e02a (HEAD, refs/bisect/bad)
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Sep 6 17:25:49 2023 +0200

    Middle-end _BitInt support [PR102989]

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

* [Bug other/111329] [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4
  2023-09-07 18:39 [Bug other/111329] New: [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4 seurer at gcc dot gnu.org
@ 2023-09-07 18:53 ` jakub at gcc dot gnu.org
  2023-09-07 19:07 ` [Bug analyzer/111329] " dmalcolm at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-07 18:53 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I don't think that is a correct bi-section, I don't think my patch has anything
to do with that.
I see zero difference in the output between r14-3744 and r14-3745, in fact I
don't see any difference in output between r14-2029 (when these options were
introduced) and latest trunk.
But the test includes <stdint.h>, perhaps that header changed?

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

* [Bug analyzer/111329] [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4
  2023-09-07 18:39 [Bug other/111329] New: [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4 seurer at gcc dot gnu.org
  2023-09-07 18:53 ` [Bug other/111329] " jakub at gcc dot gnu.org
@ 2023-09-07 19:07 ` dmalcolm at gcc dot gnu.org
  2023-09-07 19:23 ` seurer at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2023-09-07 19:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Possibly another duplicate of bug 110483.

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

* [Bug analyzer/111329] [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4
  2023-09-07 18:39 [Bug other/111329] New: [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4 seurer at gcc dot gnu.org
  2023-09-07 18:53 ` [Bug other/111329] " jakub at gcc dot gnu.org
  2023-09-07 19:07 ` [Bug analyzer/111329] " dmalcolm at gcc dot gnu.org
@ 2023-09-07 19:23 ` seurer at gcc dot gnu.org
  2023-09-07 19:46 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: seurer at gcc dot gnu.org @ 2023-09-07 19:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from seurer at gcc dot gnu.org ---
It is the one that appears to trigger this failure, though.  And as for being a
duplicate of that other one I see this on both powerpc64 BE and LE.

git bisect log

git bisect start
# good: [1b4c70d4271a00514ae20970d483c3b78d9d66ef] RISC-V: Fix VSETVL PASS
AVL/VL fetch bug[111295]
git bisect good 1b4c70d4271a00514ae20970d483c3b78d9d66ef
# bad: [52e2aaaa70e847d240fb68a27c88ee60189515a6] Additional _BitInt test
coverage [PR102989]
git bisect bad 52e2aaaa70e847d240fb68a27c88ee60189515a6
# bad: [8c984a1c3693df63520558631c827bb2c2d8b5bc] C _BitInt support [PR102989]
git bisect bad 8c984a1c3693df63520558631c827bb2c2d8b5bc
# bad: [b38deff6127778fed453bb647e32738ba5c78e33] i386: Enable _BitInt on
x86-64 [PR102989]
git bisect bad b38deff6127778fed453bb647e32738ba5c78e33
# bad: [4f4fa2501186e43d115238ae938b3df322c9e02a] Middle-end _BitInt support
[PR102989]
git bisect bad 4f4fa2501186e43d115238ae938b3df322c9e02a
# good: [6b96de22d6bcadb45530c1898b264e4738afa4fd] RISC-V: Fix incorrect mode
tieable which cause ICE in RA[PR111296]
git bisect good 6b96de22d6bcadb45530c1898b264e4738afa4fd
# first bad commit: [4f4fa2501186e43d115238ae938b3df322c9e02a] Middle-end
_BitInt support [PR102989]


g:6b96de22d6bcadb45530c1898b264e4738afa4fd, r14-3744-g6b96de22d6bcad
make  -k check-gcc
RUNTESTFLAGS="analyzer.exp=gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c"
# of expected passes            4


g:4f4fa2501186e43d115238ae938b3df322c9e02a, r14-3745-g4f4fa2501186e4
make  -k check-gcc
RUNTESTFLAGS="analyzer.exp=gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c"
FAIL: gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c expected multiline
pattern lines 17-39
FAIL: gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c 2 blank line(s) in output
FAIL: gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c (test for excess errors)
# of expected passes            2
# of unexpected failures        3

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

* [Bug analyzer/111329] [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4
  2023-09-07 18:39 [Bug other/111329] New: [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4 seurer at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-09-07 19:23 ` seurer at gcc dot gnu.org
@ 2023-09-07 19:46 ` jakub at gcc dot gnu.org
  2023-09-08  5:20 ` rsandifo at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-07 19:46 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Ah, actually that patch changed the definition of pp_wide_int macro
https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/pretty-print.h;h=6eb99b1f6901e4367687081dcd21298719ccdc40;hp=369be6e7ba767bfbf2ccf74d5e602371279726f4;hb=4f4fa2501186e4;hpb=6b96de22d6bcadb45530c1898b264e4738afa4fd
because with the larger precision wide_int the fixed size buffer isn't enough.
Now, in the analyzer case, seems it is used with a function call
      pp_wide_int (pp, get_last_byte_offset (), SIGNED);
and perhaps the const wide_int_ref in that case binds to a temporary which goes
out of scope at the end of the statement.
So, if we want to support such usages, wonder if I don't need to rewrite
pp_wide_int macro into an inline function and perhaps use there an out of line
function for the larger precision case (because XALLOCAVEC will cause inlining
to fail).

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

* [Bug analyzer/111329] [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4
  2023-09-07 18:39 [Bug other/111329] New: [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4 seurer at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-09-07 19:46 ` jakub at gcc dot gnu.org
@ 2023-09-08  5:20 ` rsandifo at gcc dot gnu.org
  2023-09-08  9:28 ` [Bug middle-end/111329] " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2023-09-08  5:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
Yeah, rewriting it to an inline function sounds like the right
fix to me FWIW.  The call looks valid.

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

* [Bug middle-end/111329] [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4
  2023-09-07 18:39 [Bug other/111329] New: [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4 seurer at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-09-08  5:20 ` rsandifo at gcc dot gnu.org
@ 2023-09-08  9:28 ` jakub at gcc dot gnu.org
  2023-09-11  9:10 ` cvs-commit at gcc dot gnu.org
  2023-09-11  9:13 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-08  9:28 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2023-09-08
     Ever confirmed|0                           |1

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 55854
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55854&action=edit
gcc14-pr111329.patch

So far only very lightly tested patch (tested that the test FAILs in
bootstrapped build, applied patch, make -j32 in the stage3 directory, make
check for the test again, which now PASSes).
Had to put the out of line function into wide-int-print.cc rather than
pretty-print.cc, because otherwise e.g. modula2 doesn't link.

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

* [Bug middle-end/111329] [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4
  2023-09-07 18:39 [Bug other/111329] New: [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4 seurer at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-09-08  9:28 ` [Bug middle-end/111329] " jakub at gcc dot gnu.org
@ 2023-09-11  9:10 ` cvs-commit at gcc dot gnu.org
  2023-09-11  9:13 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-11  9:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:6f7f728746818062c3d6ed7ea9c7cb1562f2acb1

commit r14-3836-g6f7f728746818062c3d6ed7ea9c7cb1562f2acb1
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Sep 11 11:08:41 2023 +0200

    pretty-print: Fix up pp_wide_int [PR111329]

    The recent pp_wide_int changes for _BitInt support (because not all
    wide_ints fit into the small fixed size digit_buffer anymore) apparently
    broke
    +FAIL: gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c (test for excess
errors)
    +FAIL: gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c 2 blank line(s) in
output
    +FAIL: gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c expected multiline
pattern lines 17-39
    (and I couldn't reproduce that in bisect seed (which is -O0 compiled) and
    thought it would be some analyzer diagnostic bug).

    The problem is that analyzer uses pp_wide_int with a function call in the
    second argument.  Previously, when pp_wide_int macro just did
      print_dec (W, pp_buffer (PP)->digit_buffer, SGN);
      pp_string (PP, pp_buffer (PP)->digit_buffer);
    it worked, because the const wide_int_ref & first argument to print_dec
    bound to a temporary, which was only destructed at the end of the full
    statement after print_dec was called.
    But with my changes where I need to first compare the precision of the
    const wide_int_ref & to decide whether to use digit_buffer or XALLOCAVEC
    something larger, this means that pp_wide_int_ref binds to a temporary
    which is destroyed at the end of full statement which is the
      const wide_int_ref &pp_wide_int_ref = (W);
    declaration, so then invokes UB accessing a destructed temporary.

    The following patch fixes it by rewriting pp_wide_int into an inline
    function, so that the end of the full statement is the end of the inline
    function call.  As functions using alloca aren't normally inlined, I've
    also split that part into a separate out of line function.  Putting that
    into pretty-print.cc didn't work, e.g. the gm2 binary doesn't link,
    because pretty-print.o is in libcommon.a, but wide-print-print.o which
    defines print_dec is not.  So I've put that out of line function into
    wide-int-print.cc instead.

    2023-09-11  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/111329
            * pretty-print.h (pp_wide_int): Rewrite from macro into inline
            function.  For printing values which don't fit into digit_buffer
            use out-of-line function.
            * wide-int-print.h (pp_wide_int_large): Declare.
            * wide-int-print.cc: Include pretty-print.h.
            (pp_wide_int_large): Define.

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

* [Bug middle-end/111329] [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4
  2023-09-07 18:39 [Bug other/111329] New: [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4 seurer at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-09-11  9:10 ` cvs-commit at gcc dot gnu.org
@ 2023-09-11  9:13 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-11  9:13 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Should be fixed now.

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

end of thread, other threads:[~2023-09-11  9:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-07 18:39 [Bug other/111329] New: [14 regression] gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c fails after r14-3745-g4f4fa2501186e4 seurer at gcc dot gnu.org
2023-09-07 18:53 ` [Bug other/111329] " jakub at gcc dot gnu.org
2023-09-07 19:07 ` [Bug analyzer/111329] " dmalcolm at gcc dot gnu.org
2023-09-07 19:23 ` seurer at gcc dot gnu.org
2023-09-07 19:46 ` jakub at gcc dot gnu.org
2023-09-08  5:20 ` rsandifo at gcc dot gnu.org
2023-09-08  9:28 ` [Bug middle-end/111329] " jakub at gcc dot gnu.org
2023-09-11  9:10 ` cvs-commit at gcc dot gnu.org
2023-09-11  9:13 ` jakub 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).