public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/112991] New: [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05
@ 2023-12-12 23:51 slyfox at gcc dot gnu.org
  2023-12-13  0:09 ` [Bug tree-optimization/112991] [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 since r14-6457 jakub at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: slyfox at gcc dot gnu.org @ 2023-12-12 23:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112991
           Summary: [14 Regression] ICE during GIMPLE pass: ifcvt on
                    p7zip-17.05
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

Noticed ICE on current gcc-master when built p7zip-17.05 with
r14-6466-gcd7d0b4cf78926 . Minimized example:

$ cat a.c.c
typedef struct {
  unsigned links[2];
} RMF_unit;
long RMF_recurseListsBound_count;
int RMF_recurseListsBound_tbl, RMF_recurseListsBound_list_head_1;
unsigned RMF_recurseListsBound_list_head_0;
void RMF_recurseListsBound() {
  int list_count = RMF_recurseListsBound_list_head_1;
  long link = RMF_recurseListsBound_list_head_0;
  for (; RMF_recurseListsBound_count;) {
    long next_link =
        ((RMF_unit *)&RMF_recurseListsBound_tbl)[link >> 2].links[0];
    if (link)
      --RMF_recurseListsBound_count;
    link = next_link;
  }
  while (list_count)
    ;
}

$ gcc -std=gnu11 -O2  -c a.c.c -O2 -Wall -Werror
a.c.c: In function 'RMF_recurseListsBound':
a.c.c:12:49: error: array subscript 'RMF_unit[0]' is partly outside array
bounds of 'int[1]' [-Werror=array-bounds=]
   12 |         ((RMF_unit *)&RMF_recurseListsBound_tbl)[link >> 2].links[0];
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
a.c.c:5:5: note: object 'RMF_recurseListsBound_tbl' of size 4
    5 | int RMF_recurseListsBound_tbl, RMF_recurseListsBound_list_head_1;
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~
during GIMPLE pass: ifcvt
a.c.c:7:6: internal compiler error: Segmentation fault
    7 | void RMF_recurseListsBound() {
      |      ^~~~~~~~~~~~~~~~~~~~~
0x1e367b4 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char
const*, __va_list_tag (*) [1], diagnostic_t)
        ???:0
0x1e36f99 internal_error(char const*, ...)
        ???:0
0xd621af crash_signal(int)
        ???:0
0x9d2ad0 tree_single_nonnegative_warnv_p(tree_node*, bool*, int)
        ???:0
0xa3be95 gimple_stmt_nonnegative_warnv_p(gimple*, bool*, int)
        ???:0
0x9d2c45 tree_expr_nonnegative_p(tree_node*)
        ???:0
0x123e667 gimple_simplify_369(gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), tree_node*, tree_node**, tree_code)
        ???:0
0x13978ff gimple_simplify_RSHIFT_EXPR(gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), code_helper, tree_node*, tree_node*, tree_node*)
        ???:0
0x139e78d gimple_resimplify2(gimple**, gimple_match_op*, tree_node*
(*)(tree_node*))
        ???:0
0x139f327 gimple_simplify(gimple*, gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), tree_node* (*)(tree_node*))
        ???:0
0xa30915 gimple_fold_stmt_to_constant_1(gimple*, tree_node* (*)(tree_node*),
tree_node* (*)(tree_node*))
        ???:0
0xf3f55c visit_stmt(gimple*, bool) [clone .isra.0]
        ???:0
0xf4000d process_bb(rpo_elim&, basic_block_def*, bool, bool, bool, bool, bool,
bitmap_head*, bool)
        ???:0
0xf417d7 do_rpo_vn_1(function*, edge_def*, bitmap_head*, bool, bool,
vn_lookup_kind)
        ???:0
0xf42a2a do_rpo_vn(function*, edge_def*, bitmap_head*, bool, bool,
vn_lookup_kind)
        ???:0
0xdcdbd6 tree_if_conversion(loop*, vec<gimple*, va_heap, vl_ptr>*)
        ???:0
0xdd030a (anonymous namespace)::pass_if_conversion::execute(function*)
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ gcc -v
Using built-in specs.
COLLECT_GCC=/<<NIX>>/gcc-14.0.0/bin/gcc
COLLECT_LTO_WRAPPER=/<<NIX>>/gcc-14.0.0/libexec/gcc/x86_64-unknown-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../source/configure --prefix=/<<NIX>>/gcc-14.0.0
--with-gmp-include=/<<NIX>>/gmp-6.3.0-dev/include
--with-gmp-lib=/<<NIX>>/gmp-6.3.0/lib
--with-mpfr-include=/<<NIX>>/mpfr-4.2.1-dev/include
--with-mpfr-lib=/<<NIX>>/mpfr-4.2.1/lib --with-mpc=/<<NIX>>/libmpc-1.3.1
--with-native-system-header-dir=/<<NIX>>/glibc-2.38-27-dev/include
--with-build-sysroot=/ --program-prefix= --enable-lto --disable-libstdcxx-pch
--without-included-gettext --with-system-zlib --enable-checking=release
--enable-static --enable-languages=c,c++ --disable-multilib --enable-plugin
--disable-libcc1 --with-isl=/<<NIX>>/isl-0.20 --disable-bootstrap
--build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu
--target=x86_64-unknown-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 99999999 (experimental) (GCC)

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

* [Bug tree-optimization/112991] [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 since r14-6457
  2023-12-12 23:51 [Bug tree-optimization/112991] New: [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 slyfox at gcc dot gnu.org
@ 2023-12-13  0:09 ` jakub at gcc dot gnu.org
  2023-12-13  0:09 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-13  0:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
   Target Milestone|---                         |14.0
            Summary|[14 Regression] ICE during  |[14 Regression] ICE during
                   |GIMPLE pass: ifcvt on       |GIMPLE pass: ifcvt on
                   |p7zip-17.05                 |p7zip-17.05 since r14-6457

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r14-6457-g878cb5acf0c499702ffd315e273f55e8bd0970b8

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

* [Bug tree-optimization/112991] [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 since r14-6457
  2023-12-12 23:51 [Bug tree-optimization/112991] New: [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 slyfox at gcc dot gnu.org
  2023-12-13  0:09 ` [Bug tree-optimization/112991] [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 since r14-6457 jakub at gcc dot gnu.org
@ 2023-12-13  0:09 ` jakub at gcc dot gnu.org
  2023-12-13  7:37 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-13  0:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-12-13
     Ever confirmed|0                           |1

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

* [Bug tree-optimization/112991] [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 since r14-6457
  2023-12-12 23:51 [Bug tree-optimization/112991] New: [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 slyfox at gcc dot gnu.org
  2023-12-13  0:09 ` [Bug tree-optimization/112991] [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 since r14-6457 jakub at gcc dot gnu.org
  2023-12-13  0:09 ` jakub at gcc dot gnu.org
@ 2023-12-13  7:37 ` rguenth at gcc dot gnu.org
  2023-12-13  8:44 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-12-13  7:37 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmpf, so of course we walk outside of the region with tree_expr_nonnegative_p.

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

* [Bug tree-optimization/112991] [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 since r14-6457
  2023-12-12 23:51 [Bug tree-optimization/112991] New: [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 slyfox at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-12-13  7:37 ` rguenth at gcc dot gnu.org
@ 2023-12-13  8:44 ` cvs-commit at gcc dot gnu.org
  2023-12-13  8:44 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-13  8:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:93db32a4146afd2a6d90410691351a56768167c9

commit r14-6483-g93db32a4146afd2a6d90410691351a56768167c9
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Dec 13 08:45:58 2023 +0100

    tree-optimization/112991 - re-do PR112961 fix

    The following does away with the fake edge adding as in the original
    PR112961 fix and instead exposes handling of entry PHIs as additional
    parameter of the region VN run.

            PR tree-optimization/112991
            PR tree-optimization/112961
            * tree-ssa-sccvn.h (do_rpo_vn): Add skip_entry_phis argument.
            * tree-ssa-sccvn.cc (do_rpo_vn): Likewise.
            (do_rpo_vn_1): Likewise, merge with auto-processing.
            (run_rpo_vn): Adjust.
            (pass_fre::execute): Likewise.
            * tree-if-conv.cc (tree_if_conversion): Revert last change.
            Value-number latch block but disable value-numbering of
            entry PHIs.
            * tree-ssa-uninit.cc (execute_early_warn_uninitialized): Adjust.

            * gcc.dg/torture/pr112991.c: New testcase.

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

* [Bug tree-optimization/112991] [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 since r14-6457
  2023-12-12 23:51 [Bug tree-optimization/112991] New: [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 slyfox at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-12-13  8:44 ` cvs-commit at gcc dot gnu.org
@ 2023-12-13  8:44 ` rguenth at gcc dot gnu.org
  2023-12-13 10:30 ` slyfox at gcc dot gnu.org
  2024-05-08 11:50 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-12-13  8:44 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

* [Bug tree-optimization/112991] [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 since r14-6457
  2023-12-12 23:51 [Bug tree-optimization/112991] New: [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 slyfox at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-12-13  8:44 ` rguenth at gcc dot gnu.org
@ 2023-12-13 10:30 ` slyfox at gcc dot gnu.org
  2024-05-08 11:50 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: slyfox at gcc dot gnu.org @ 2023-12-13 10:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
The change also fixes p7zip-17.05 build for me. Thank you!

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

* [Bug tree-optimization/112991] [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 since r14-6457
  2023-12-12 23:51 [Bug tree-optimization/112991] New: [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 slyfox at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-12-13 10:30 ` slyfox at gcc dot gnu.org
@ 2024-05-08 11:50 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-08 11:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:25add4b65a3bac262685d290a4dc93884a022576

commit r13-8719-g25add4b65a3bac262685d290a4dc93884a022576
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Dec 13 08:45:58 2023 +0100

    tree-optimization/112991 - re-do PR112961 fix

    The following does away with the fake edge adding as in the original
    PR112961 fix and instead exposes handling of entry PHIs as additional
    parameter of the region VN run.

            PR tree-optimization/112991
            PR tree-optimization/112961
            * tree-ssa-sccvn.h (do_rpo_vn): Add skip_entry_phis argument.
            * tree-ssa-sccvn.cc (do_rpo_vn): Likewise.
            (do_rpo_vn_1): Likewise, merge with auto-processing.
            (run_rpo_vn): Adjust.
            (pass_fre::execute): Likewise.
            * tree-if-conv.cc (tree_if_conversion): Revert last change.
            Value-number latch block but disable value-numbering of
            entry PHIs.
            * tree-ssa-uninit.cc (execute_early_warn_uninitialized): Adjust.

            * gcc.dg/torture/pr112991.c: New testcase.
            * g++.dg/vect/pr112961.cc: Likewise.

    (cherry picked from commit 93db32a4146afd2a6d90410691351a56768167c9)

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

end of thread, other threads:[~2024-05-08 11:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-12 23:51 [Bug tree-optimization/112991] New: [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 slyfox at gcc dot gnu.org
2023-12-13  0:09 ` [Bug tree-optimization/112991] [14 Regression] ICE during GIMPLE pass: ifcvt on p7zip-17.05 since r14-6457 jakub at gcc dot gnu.org
2023-12-13  0:09 ` jakub at gcc dot gnu.org
2023-12-13  7:37 ` rguenth at gcc dot gnu.org
2023-12-13  8:44 ` cvs-commit at gcc dot gnu.org
2023-12-13  8:44 ` rguenth at gcc dot gnu.org
2023-12-13 10:30 ` slyfox at gcc dot gnu.org
2024-05-08 11:50 ` cvs-commit 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).