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

Reply via email to