public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/111802] New: New analyser diagram failures since commit b365e9d57ad4
@ 2023-10-13 19:22 thiago.bauermann at linaro dot org
  2024-02-15 14:58 ` [Bug analyzer/111802] " dmalcolm at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: thiago.bauermann at linaro dot org @ 2023-10-13 19:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111802
           Summary: New analyser diagram failures since commit
                    b365e9d57ad4
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: thiago.bauermann at linaro dot org
  Target Milestone: ---
            Target: armv8l-linux-gnueabihf

Created attachment 56102
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56102&action=edit
Testsuite logs of analyser.exp from today's trunk.

After commit b365e9d57ad4 ("analyzer: improvements to out-of-bounds diagrams
[PR111155]"), the following failures started appearing on
armv8l-linux-gnueabihf:

                === g++ tests ===

Running g++:g++.dg/analyzer/analyzer.exp ...
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat-2.c -std=c++14  2
blank line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat-2.c -std=c++14 
expected multiline pattern lines 50-73
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat-2.c -std=c++14 (test
for excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat-2.c -std=c++17  2
blank line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat-2.c -std=c++17 
expected multiline pattern lines 50-73
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat-2.c -std=c++17 (test
for excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat-2.c -std=c++20  2
blank line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat-2.c -std=c++20 
expected multiline pattern lines 50-73
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat-2.c -std=c++20 (test
for excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat-2.c -std=c++98  2
blank line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat-2.c -std=c++98 
expected multiline pattern lines 50-73
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat-2.c -std=c++98 (test
for excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat.c -std=c++14  2 blank
line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat.c -std=c++14  expected
multiline pattern lines 42-65
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat.c -std=c++14 (test for
excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat.c -std=c++17  2 blank
line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat.c -std=c++17  expected
multiline pattern lines 42-65
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat.c -std=c++17 (test for
excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat.c -std=c++20  2 blank
line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat.c -std=c++20  expected
multiline pattern lines 42-65
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat.c -std=c++20 (test for
excess errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat.c -std=c++98  2 blank
line(s) in output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat.c -std=c++98  expected
multiline pattern lines 42-65
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat.c -std=c++98 (test for
excess errors)
                === gcc tests ===

Running gcc:gcc.dg/analyzer/analyzer.exp ...
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat-2.c (test for excess
errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat-2.c 2 blank line(s) in
output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat-2.c expected multiline
pattern lines 23-46
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat.c (test for excess
errors)
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat.c 2 blank line(s) in
output
FAIL: c-c++-common/analyzer/out-of-bounds-diagram-strcat.c expected multiline
pattern lines 15-38
FAIL: gcc.dg/analyzer/out-of-bounds-diagram-17.c expected multiline pattern
lines 14-35
FAIL: gcc.dg/analyzer/out-of-bounds-diagram-18.c expected multiline pattern
lines 14-43
FAIL: gcc.dg/analyzer/out-of-bounds-diagram-19.c expected multiline pattern
lines 25-46

They appear on builds configured with ‘--with-build-config=bootstrap-lto’, but
not on builds with just ‘--enable-bootstrap’, nor in builds configured with
‘--disable-bootstrap’, so perhaps it's an issue with LTO?

The failures happen because the string literal indexes in the diagrams are all
“[1]” instead of the expected “[0]”, “[1]”, “[2]”, etc. E.g.:

FAIL: gcc.dg/analyzer/out-of-bounds-diagram-17.c expected multiline pattern
lines 14-35
FAIL: gcc.dg/analyzer/out-of-bounds-diagram-17.c 2 blank line(s) in output
FAIL: gcc.dg/analyzer/out-of-bounds-diagram-17.c (test for excess errors)
Excess errors:
                             ┌────┬────┬────┬────┬────┐┌─────┬─────┬─────┐
                             │[1] │[1] │[1] │[1] │[1] ││ [1] │ [1] │ [1] │
                             ├────┼────┼────┼────┼────┤├─────┼─────┼─────┤
                             │' ' │'w' │'o' │'r' │'l' ││ 'd' │ '!' │ NUL │
                             ├────┴────┴────┴────┴────┴┴─────┴─────┴─────┤
                             │     string literal (type: 'char[8]')      │
                             └───────────────────────────────────────────┘
                               │    │    │    │    │      │     │     │
                               │    │    │    │    │      │     │     │
                               v    v    v    v    v      v     v     v
  ┌─────┬────────────────────┬────┬──────────────┬────┐┌─────────────────┐
  │ [0] │        ...         │[5] │     ...      │[9] ││                 │
  ├─────┼────┬────┬────┬────┬┼────┼──────────────┴────┘│                 │
  │ 'h' │'e' │'l' │'l' │'o' ││NUL │                    │after valid range│
  ├─────┴────┴────┴────┴────┴┴────┴───────────────────┐│                 │
  │             'buf' (type: 'char[10]')              ││                 │
  └───────────────────────────────────────────────────┘└─────────────────┘
  ├─────────────────────────┬─────────────────────────┤├────────┬────────┤
                            │                                   │
                  ╭─────────┴────────╮                ╭─────────┴─────────╮
                  │capacity: 10 bytes│                │overflow of 3 bytes│
                  ╰──────────────────╯                ╰───────────────────╯


I tested on today's trunk (commit 8be20f3b0bde) and the failures are still
present. I'm attaching the {gcc,g++}.{sum,log} files for trunk.

Here are is the full configure && make command line:

$ ~/src/gcc-wt/configure \
    SHELL=/bin/bash \
    --with-gnu-as \
    --with-gnu-ld \
    --disable-libmudflap \
    --enable-lto \
    --enable-shared \
    --without-included-gettext \
    --enable-nls \
    --with-system-zlib \
    --disable-sjlj-exceptions \
    --enable-gnu-unique-object \
    --enable-linker-build-id \
    --disable-libstdcxx-pch \
    --enable-c99 \
    --enable-clocale=gnu \
    --enable-libstdcxx-debug \
    --enable-long-long \
    --with-cloog=no \
    --with-ppl=no \
    --with-isl=no \
    --disable-multilib \
    --with-float=hard \
    --with-fpu=neon-fp-armv8 \
    --with-mode=thumb \
    --with-arch=armv8-a \
    --enable-threads=posix \
    --enable-multiarch \
    --enable-libstdcxx-time=yes \
    --enable-gnu-indirect-function \
    --enable-checking=yes \
    --enable-bootstrap \
    --with-build-config=bootstrap-lto \
    --enable-languages=c,c++,fortran,lto \
&& make \
    SHELL=/bin/bash \
    -w \
    -j 80 \
    CFLAGS_FOR_BUILD="-pipe -g -O2" \
    CXXFLAGS_FOR_BUILD="-pipe -g -O2" \
    LDFLAGS_FOR_BUILD="-static-libgcc" \
    MAKEINFOFLAGS=--force \
    BUILD_INFO="" \
    MAKEINFO=echo

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

* [Bug analyzer/111802] New analyser diagram failures since commit b365e9d57ad4
  2023-10-13 19:22 [Bug analyzer/111802] New: New analyser diagram failures since commit b365e9d57ad4 thiago.bauermann at linaro dot org
@ 2024-02-15 14:58 ` dmalcolm at gcc dot gnu.org
  2024-02-15 18:15 ` thiago.bauermann at linaro dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2024-02-15 14:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Thanks for filing this bug report.

The issue seems to be with the top line here:
                             ┌────┬────┬────┬────┬────┐┌─────┬─────┬─────┐
                             │[1] │[1] │[1] │[1] │[1] ││ [1] │ [1] │ [1] │
                             ├────┼────┼────┼────┼────┤├─────┼─────┼─────┤
                             │' ' │'w' │'o' │'r' │'l' ││ 'd' │ '!' │ NUL │
                             ├────┴────┴────┴────┴────┴┴─────┴─────┴─────┤
                             │     string literal (type: 'char[8]')      │
                             └───────────────────────────────────────────┘
where the repeated "[1]"s are meant to be 0 through 7.

Does this still affect you?

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

* [Bug analyzer/111802] New analyser diagram failures since commit b365e9d57ad4
  2023-10-13 19:22 [Bug analyzer/111802] New: New analyser diagram failures since commit b365e9d57ad4 thiago.bauermann at linaro dot org
  2024-02-15 14:58 ` [Bug analyzer/111802] " dmalcolm at gcc dot gnu.org
@ 2024-02-15 18:15 ` thiago.bauermann at linaro dot org
  2024-02-27 22:19 ` [Bug analyzer/111802] [14 Regression] " cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: thiago.bauermann at linaro dot org @ 2024-02-15 18:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Thiago Jung Bauermann <thiago.bauermann at linaro dot org> ---
Thank you for responding.

Yes, I checked commit 5266f930bed0 ("Daily bump.") from yesterday and it's
still present.

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

* [Bug analyzer/111802] [14 Regression] New analyser diagram failures since commit b365e9d57ad4
  2023-10-13 19:22 [Bug analyzer/111802] New: New analyser diagram failures since commit b365e9d57ad4 thiago.bauermann at linaro dot org
  2024-02-15 14:58 ` [Bug analyzer/111802] " dmalcolm at gcc dot gnu.org
  2024-02-15 18:15 ` thiago.bauermann at linaro dot org
@ 2024-02-27 22:19 ` cvs-commit at gcc dot gnu.org
  2024-02-27 22:29 ` dmalcolm at gcc dot gnu.org
  2024-03-01 17:30 ` thiago.bauermann at linaro dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-27 22:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Malcolm <dmalcolm@gcc.gnu.org>:

https://gcc.gnu.org/g:939439a90f234f9e70d30240bf5c227eebe2b43f

commit r14-9199-g939439a90f234f9e70d30240bf5c227eebe2b43f
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Tue Feb 27 14:49:42 2024 -0500

    analyzer: use correct format code for string literal indices
[PR110483,PR111802]

    On e.g. gcc211 the use of "%li" with unsigned HOST_WIDE_INT led to this
warning:
    ../../src/gcc/analyzer/access-diagram.cc: In member function âvoid
ana::string_literal_spatial_item::add_column_for_byte(text_art::table&, const
ana::bit_to_table_map&, text_art::style_manager&, ana::byte_offset_t,
ana::byte_offset_t, int, int) constâ:
    ../../src/gcc/analyzer/access-diagram.cc:1909:40: warning: format â%liâ
expects argument of type âlong intâ, but argument 3 has type âlong long
unsigned intâ [-Wformat=]
              byte_idx_within_string.ulow ()));
                                            ^
    and to all values being erroneously printed as "0".

    Fixed thusly.

    gcc/analyzer/ChangeLog:
            PR analyzer/110483
            PR analyzer/111802
            * access-diagram.cc
            (string_literal_spatial_item::add_column_for_byte): Use %wu for
            printing unsigned HOST_WIDE_INT.

    Signed-off-by: David Malcolm <dmalcolm@redhat.com>

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

* [Bug analyzer/111802] [14 Regression] New analyser diagram failures since commit b365e9d57ad4
  2023-10-13 19:22 [Bug analyzer/111802] New: New analyser diagram failures since commit b365e9d57ad4 thiago.bauermann at linaro dot org
                   ` (2 preceding siblings ...)
  2024-02-27 22:19 ` [Bug analyzer/111802] [14 Regression] " cvs-commit at gcc dot gnu.org
@ 2024-02-27 22:29 ` dmalcolm at gcc dot gnu.org
  2024-03-01 17:30 ` thiago.bauermann at linaro dot org
  4 siblings, 0 replies; 6+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2024-02-27 22:29 UTC (permalink / raw)
  To: gcc-bugs

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

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

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

--- Comment #4 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Should be fixed by the above patch; closing.  Please reopen if you still see
these issues.

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

* [Bug analyzer/111802] [14 Regression] New analyser diagram failures since commit b365e9d57ad4
  2023-10-13 19:22 [Bug analyzer/111802] New: New analyser diagram failures since commit b365e9d57ad4 thiago.bauermann at linaro dot org
                   ` (3 preceding siblings ...)
  2024-02-27 22:29 ` dmalcolm at gcc dot gnu.org
@ 2024-03-01 17:30 ` thiago.bauermann at linaro dot org
  4 siblings, 0 replies; 6+ messages in thread
From: thiago.bauermann at linaro dot org @ 2024-03-01 17:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Thiago Jung Bauermann <thiago.bauermann at linaro dot org> ---
I can confirm this is fixed in our setup. Thank you!

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-13 19:22 [Bug analyzer/111802] New: New analyser diagram failures since commit b365e9d57ad4 thiago.bauermann at linaro dot org
2024-02-15 14:58 ` [Bug analyzer/111802] " dmalcolm at gcc dot gnu.org
2024-02-15 18:15 ` thiago.bauermann at linaro dot org
2024-02-27 22:19 ` [Bug analyzer/111802] [14 Regression] " cvs-commit at gcc dot gnu.org
2024-02-27 22:29 ` dmalcolm at gcc dot gnu.org
2024-03-01 17:30 ` thiago.bauermann at linaro dot 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).