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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <[email protected]>:

https://gcc.gnu.org/g:4c2d129334af54313285fd97ea921ea150ec9b59

commit r16-8079-g4c2d129334af54313285fd97ea921ea150ec9b59
Author: Jakub Jelinek <[email protected]>
Date:   Fri Mar 13 14:11:57 2026 +0100

    testsuite: Fix up gcc.dg/analyzer/ice-pr124375-1.c for 32-bit targets
[PR124375]

    On Wed, Mar 11, 2026 at 08:51:03PM -0400, David Malcolm wrote:
    >       * gcc.dg/analyzer/ice-pr124375-1.c: New test.

    Unfortunately this test FAILs on i686-linux (and guess all
    other sizeof (int) == sizeof (__PTRDIFF_TYPE__) targets).

    The problem is that on x86_64-linux the warning is indeed emitted on the
      __printf_buffer_offset = __printf_buffer_spec /* { dg-warning
"stack-based buffer over-read" } */
    line but on i686-linux (or x86_64-linux with -m32) on the
                                   : step0_jumps[' '];
    line.  I think the difference is due to a useless cast missing on the
latter
    (int and __PTRDIFF_TYPE__ are either the same or uselessly compatible, so
    there is no extra cast stmt which holds some particular location).
    On lp64 the above is (int)(__print_buffer_spec ? &&do_form_unknown -
&&do_form_unknown
    : (__PTRDIFF_TYPE__) step0_jumps[' ']);

    So, either we would need to expect this dg-warning for say lp64 only and
    expect a dg-warning on the other line for ilp32 (but what to do for
    non-lp64/ilp32 targets?), or limit the test to lp64 only, or the following
    patch just forces it onto one line (we regularly go over the 80 line limit
    in the testsuite, often by a lot) and then it really doesn't matter on
which
    column the warning is emitted.

    Tested on x86_64-linux and i686-linux by making sure the pre r16-8019
    still ICEd on it (both 64-bit and 32-bit) and that latest trunk warns
    on the right line with both.

    2026-03-13  Jakub Jelinek  <[email protected]>

            PR analyzer/124375
            * gcc.dg/analyzer/ice-pr124375-1.c (__printf_buffer): Put the whole
?:
            expression on a single line.

Reply via email to