public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/111338] New: ice in vn_walk_cb_data
@ 2023-09-08  8:52 dcb314 at hotmail dot com
  2023-09-08 10:11 ` [Bug c/111338] " dcb314 at hotmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: dcb314 at hotmail dot com @ 2023-09-08  8:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111338
           Summary: ice in vn_walk_cb_data
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

From the gcc testsuite:

$ ~/gcc/results/bin/gcc -c -w ./gcc.dg/bitint-18.c
$
$ ~/gcc/results/bin/gcc -c -w -O1 ./gcc.dg/bitint-18.c
during GIMPLE pass: fre
./gcc.dg/bitint-18.c: In function ‘main’:
./gcc.dg/bitint-18.c:44:1: internal compiler error: in vn_walk_cb_data, at
tree-ssa-sccvn.cc:1866
   44 | }
      | ^
0x10897ff vn_walk_cb_data::vn_walk_cb_data(vn_reference_s*, tree_node*,
tree_node**, vn_lookup_kind, bool, tree_node*, bool)
        ../../trunk.year/gcc/tree-ssa-sccvn.cc:1866
0x10784e7 vn_reference_lookup(tree_node*, tree_node*, vn_lookup_kind,
vn_reference_s**, bool, tree_node**, tree_node*, bool)
        ../../trunk.year/gcc/tree-ssa-sccvn.cc:4017
0x10860ec visit_nary_op(tree_node*, gassign*)
        ../../trunk.year/gcc/tree-ssa-sccvn.cc:5427

$ ~/gcc/results/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/home/dcb38/gcc/results/bin/gcc
COLLECT_LTO_WRAPPER=/home/dcb38/gcc/results.20230908.asan.ubsan/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../trunk.year/configure
--prefix=/home/dcb38/gcc/results.20230908.asan.ubsan --disable-multilib
--disable-bootstrap --with-build-config=bootstrap-asan
--with-build-config=bootstrap-ubsan --with-pkgversion=daaed758517c81fc
--enable-checking=df,extra,fold,rtl,yes --enable-languages=c,c++,fortran
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20230907 (experimental) (daaed758517c81fc)

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

* [Bug c/111338] ice in vn_walk_cb_data
  2023-09-08  8:52 [Bug c/111338] New: ice in vn_walk_cb_data dcb314 at hotmail dot com
@ 2023-09-08 10:11 ` dcb314 at hotmail dot com
  2023-09-08 10:17 ` dcb314 at hotmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dcb314 at hotmail dot com @ 2023-09-08 10:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
Reduced code is:

_BitInt(575) e;
main() {
  __atomic_fetch_and(
      &e,
     
40418462630594385361724744395454079240140931656245750192534103967695265126850678980088699287669565365078793986191778469857714756111026776864987769580622009237241167211461,
      __ATOMIC_RELAXED);
}

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

* [Bug c/111338] ice in vn_walk_cb_data
  2023-09-08  8:52 [Bug c/111338] New: ice in vn_walk_cb_data dcb314 at hotmail dot com
  2023-09-08 10:11 ` [Bug c/111338] " dcb314 at hotmail dot com
@ 2023-09-08 10:17 ` dcb314 at hotmail dot com
  2023-09-08 10:20 ` dcb314 at hotmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dcb314 at hotmail dot com @ 2023-09-08 10:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from David Binderman <dcb314 at hotmail dot com> ---
The code first seems to go wrong sometime between g:c1597e7fb9f9ecb9
and g:10d59b802a7db9ae, which is 36 commits.

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

* [Bug c/111338] ice in vn_walk_cb_data
  2023-09-08  8:52 [Bug c/111338] New: ice in vn_walk_cb_data dcb314 at hotmail dot com
  2023-09-08 10:11 ` [Bug c/111338] " dcb314 at hotmail dot com
  2023-09-08 10:17 ` dcb314 at hotmail dot com
@ 2023-09-08 10:20 ` dcb314 at hotmail dot com
  2023-09-08 11:26 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dcb314 at hotmail dot com @ 2023-09-08 10:20 UTC (permalink / raw)
  To: gcc-bugs

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

David Binderman <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at redhat dot com

--- Comment #3 from David Binderman <dcb314 at hotmail dot com> ---
Jakub seems to have implemented a lot of the _BitInt support.

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

* [Bug c/111338] ice in vn_walk_cb_data
  2023-09-08  8:52 [Bug c/111338] New: ice in vn_walk_cb_data dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2023-09-08 10:20 ` dcb314 at hotmail dot com
@ 2023-09-08 11:26 ` jakub at gcc dot gnu.org
  2023-09-08 11:26 ` [Bug middle-end/111338] [14 Regression] " jakub 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-08 11:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Slightly cleaned up, still -O1:

_BitInt(575) e;

int
main ()
{
  __atomic_fetch_and (&e, 1, __ATOMIC_RELAXED);
}

(otherwise you'd want the wb suffix on the large constant to avoid warning).

Or even
_BitInt(575) e;

_BitInt(575)
foo (void)
{
  return e & 1;
}

The problem is that push_partial_def uses a fixed size 512-bit buffer, for
larger stuff it fails and my PR93582 patch assumed it doesn't fail.

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

* [Bug middle-end/111338] [14 Regression] ice in vn_walk_cb_data
  2023-09-08  8:52 [Bug c/111338] New: ice in vn_walk_cb_data dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2023-09-08 11:26 ` jakub at gcc dot gnu.org
@ 2023-09-08 11:26 ` jakub at gcc dot gnu.org
  2023-09-08 11:38 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-08 11:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0
            Summary|ice in vn_walk_cb_data      |[14 Regression] ice in
                   |                            |vn_walk_cb_data
          Component|c                           |middle-end
            Version|unknown                     |14.0

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

* [Bug middle-end/111338] [14 Regression] ice in vn_walk_cb_data
  2023-09-08  8:52 [Bug c/111338] New: ice in vn_walk_cb_data dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2023-09-08 11:26 ` [Bug middle-end/111338] [14 Regression] " jakub at gcc dot gnu.org
@ 2023-09-08 11:38 ` jakub at gcc dot gnu.org
  2023-09-12 10:24 ` cvs-commit at gcc dot gnu.org
  2023-09-12 10:38 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-08 11:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

Untested fix.

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

* [Bug middle-end/111338] [14 Regression] ice in vn_walk_cb_data
  2023-09-08  8:52 [Bug c/111338] New: ice in vn_walk_cb_data dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2023-09-08 11:38 ` jakub at gcc dot gnu.org
@ 2023-09-12 10:24 ` cvs-commit at gcc dot gnu.org
  2023-09-12 10:38 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-12 10:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 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:6067dbdcf77df995129214248f062d9ce18b48d8

commit r14-3875-g6067dbdcf77df995129214248f062d9ce18b48d8
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Sep 12 12:23:13 2023 +0200

    sccvn: Avoid ICEs on _BitInt load BIT_AND_EXPR mask [PR111338]

    The following testcase ICEs, because vn_walk_cb_data::push_partial_def
    uses a fixed size buffer (64 target bytes) for its
    construction/deconstruction of partial stores and fails if larger precision
    than that is needed, and the PR93582 changes assert push_partial_def
    succeeds (and check the various other conditions much earlier when seeing
    the BIT_AND_EXPR statement, like CHAR_BIT == 8, BITS_PER_UNIT == 8,
    BYTES_BIG_ENDIAN == WORDS_BIG_ENDIAN, etc.).  So, just removing the assert
    and allowing it fail there doesn't really work and ICEs later on.

    The following patch moves the bufsize out of the method and tests it
    together with the other checks.

    BTW, perhaps we could increase the bufsize as well or in addition to
    increasing it make the buffer allocated using XALLOCAVEC, but still I think
    it is useful to have some upper bound and so I think this patch is useful
    even in that case.

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

            PR middle-end/111338
            * tree-ssa-sccvn.cc (struct vn_walk_cb_data): Add bufsize
non-static
            data member.
            (vn_walk_cb_data::push_partial_def): Remove bufsize variable.
            (visit_nary_op): Avoid the BIT_AND_EXPR with constant rhs2
            optimization if type's precision is too large for
            vn_walk_cb_data::bufsize.

            * gcc.dg/bitint-37.c: New test.

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

* [Bug middle-end/111338] [14 Regression] ice in vn_walk_cb_data
  2023-09-08  8:52 [Bug c/111338] New: ice in vn_walk_cb_data dcb314 at hotmail dot com
                   ` (6 preceding siblings ...)
  2023-09-12 10:24 ` cvs-commit at gcc dot gnu.org
@ 2023-09-12 10:38 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-12 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #7 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-12 10:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-08  8:52 [Bug c/111338] New: ice in vn_walk_cb_data dcb314 at hotmail dot com
2023-09-08 10:11 ` [Bug c/111338] " dcb314 at hotmail dot com
2023-09-08 10:17 ` dcb314 at hotmail dot com
2023-09-08 10:20 ` dcb314 at hotmail dot com
2023-09-08 11:26 ` jakub at gcc dot gnu.org
2023-09-08 11:26 ` [Bug middle-end/111338] [14 Regression] " jakub at gcc dot gnu.org
2023-09-08 11:38 ` jakub at gcc dot gnu.org
2023-09-12 10:24 ` cvs-commit at gcc dot gnu.org
2023-09-12 10:38 ` 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).