public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/113002] New: ICE in commit_one_edge_insertion, at cfgrtl.cc:2095 with new -finline-stringops
@ 2023-12-13 19:36 mjires at suse dot cz
  2023-12-14  9:31 ` [Bug rtl-optimization/113002] " fkastl at suse dot cz
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mjires at suse dot cz @ 2023-12-13 19:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113002
           Summary: ICE in commit_one_edge_insertion, at cfgrtl.cc:2095
                    with new -finline-stringops
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mjires at suse dot cz
                CC: aoliva at gcc dot gnu.org
  Target Milestone: ---

Compiling reduced testcase gcc.dg/pr76783.c results in ICE with new
-finline-stringops since its addition r14-5946-g1ff6d9f7428b06.
Happens with riscv64-linux-gnu-gcc and ppc64le-linux-gnu-gcc.


$ cat pr76783.c
typedef __int128 v64u128 __attribute__((vector_size(64)));
int c;
v64u128 u;
void foo() {
  if (c)
    u = (v64u128){0};
  else
    u = (v64u128){1};
}


$ riscv64-linux-gnu-gcc pr76783.c -finline-stringops -Os
during RTL pass: expand
pr76783.c: In function ‘foo’:
pr76783.c:9:1: internal compiler error: in commit_one_edge_insertion, at
cfgrtl.cc:2095
    9 | }
      | ^
0x1286438 commit_one_edge_insertion(edge_def*)
        /home/mjires/git/GCC/master/gcc/cfgrtl.cc:2095
0x12864bf commit_edge_insertions()
        /home/mjires/git/GCC/master/gcc/cfgrtl.cc:2127
0x126337c execute
        /home/mjires/git/GCC/master/gcc/cfgexpand.cc:6926
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.


$ riscv64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/mjires/built/master/libexec/gcc/riscv64-linux-gnu/14.0.0/lto-wrapper
Target: riscv64-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --target=riscv64-linux-gnu
--disable-bootstrap --enable-languages=c,c++ --disable-multilib
--disable-libsanitizer --enable-checking
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20231213 (experimental) (GCC)

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

* [Bug rtl-optimization/113002] ICE in commit_one_edge_insertion, at cfgrtl.cc:2095 with new -finline-stringops
  2023-12-13 19:36 [Bug rtl-optimization/113002] New: ICE in commit_one_edge_insertion, at cfgrtl.cc:2095 with new -finline-stringops mjires at suse dot cz
@ 2023-12-14  9:31 ` fkastl at suse dot cz
  2023-12-20  1:43 ` aoliva at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: fkastl at suse dot cz @ 2023-12-14  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

Filip Kastl <fkastl at suse dot cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fkastl at suse dot cz

--- Comment #1 from Filip Kastl <fkastl at suse dot cz> ---
The same error also occurs while compiling gcc.dg/pr43300.c with
aarch64-linux-gnu-gcc:

aarch64-linux-gnu-gcc
/home/worker/buildworker/tiber-option-juggler/build/gcc/testsuite/gcc.dg/pr43300.c
-finline-stringops -Oz

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

* [Bug rtl-optimization/113002] ICE in commit_one_edge_insertion, at cfgrtl.cc:2095 with new -finline-stringops
  2023-12-13 19:36 [Bug rtl-optimization/113002] New: ICE in commit_one_edge_insertion, at cfgrtl.cc:2095 with new -finline-stringops mjires at suse dot cz
  2023-12-14  9:31 ` [Bug rtl-optimization/113002] " fkastl at suse dot cz
@ 2023-12-20  1:43 ` aoliva at gcc dot gnu.org
  2023-12-20  2:07 ` aoliva at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: aoliva at gcc dot gnu.org @ 2023-12-20  1:43 UTC (permalink / raw)
  To: gcc-bugs

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2023-12-20

--- Comment #2 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Mine.  memset gets expanded into a loop and inserted in an edge, and when
committing the insertion, we complain that the sequence ends in a jump.  AFAICT
it's fine if it does during expand, we'll break up blocks at suitable spots
only after committing the edge inserts from PHI nodes.  Relaxing the assert...

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

* [Bug rtl-optimization/113002] ICE in commit_one_edge_insertion, at cfgrtl.cc:2095 with new -finline-stringops
  2023-12-13 19:36 [Bug rtl-optimization/113002] New: ICE in commit_one_edge_insertion, at cfgrtl.cc:2095 with new -finline-stringops mjires at suse dot cz
  2023-12-14  9:31 ` [Bug rtl-optimization/113002] " fkastl at suse dot cz
  2023-12-20  1:43 ` aoliva at gcc dot gnu.org
@ 2023-12-20  2:07 ` aoliva at gcc dot gnu.org
  2023-12-20  8:19 ` cvs-commit at gcc dot gnu.org
  2023-12-21  3:49 ` aoliva at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: aoliva at gcc dot gnu.org @ 2023-12-20  2:07 UTC (permalink / raw)
  To: gcc-bugs

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |aoliva at gcc dot gnu.org

--- Comment #3 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Created attachment 56907
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56907&action=edit
candidate patch under test

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

* [Bug rtl-optimization/113002] ICE in commit_one_edge_insertion, at cfgrtl.cc:2095 with new -finline-stringops
  2023-12-13 19:36 [Bug rtl-optimization/113002] New: ICE in commit_one_edge_insertion, at cfgrtl.cc:2095 with new -finline-stringops mjires at suse dot cz
                   ` (2 preceding siblings ...)
  2023-12-20  2:07 ` aoliva at gcc dot gnu.org
@ 2023-12-20  8:19 ` cvs-commit at gcc dot gnu.org
  2023-12-21  3:49 ` aoliva at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-20  8:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alexandre Oliva <aoliva@gcc.gnu.org>:

https://gcc.gnu.org/g:672db38c6f0723ca57fe8ff4c43422341e7fb857

commit r14-6735-g672db38c6f0723ca57fe8ff4c43422341e7fb857
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Tue Dec 19 22:17:42 2023 -0300

    -finline-stringops: allow expansion into edges [PR113002]

    Builtin expanders for memset and memcpy may involve conditionals and
    loops, but their sequences may be end up emitted in edges.  Alas,
    commit_one_edge_insertion rejects sequences that end with a jump, a
    requirement that makes sense for insertions after expand, but not so
    much during expand.

    During expand, jumps may appear in the middle of the insert sequence
    as much as in the end, and it's only after committing edge insertions
    out of PHI nodes that we go through the entire function splitting
    blocks where needed, so relax the assert in commit_one_edge_insertion
    so that jumps are accepted during expand even at the end of the
    sequence.


    for  gcc/ChangeLog

            PR rtl-optimization/113002
            * cfgrtl.cc (commit_one_edge_insertion): Tolerate jumps in the
            inserted sequence during expand.

    for  gcc/testsuite/ChangeLog

            PR rtl-optimization/113002
            * gcc.dg/vect/pr113002.c: New.

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

* [Bug rtl-optimization/113002] ICE in commit_one_edge_insertion, at cfgrtl.cc:2095 with new -finline-stringops
  2023-12-13 19:36 [Bug rtl-optimization/113002] New: ICE in commit_one_edge_insertion, at cfgrtl.cc:2095 with new -finline-stringops mjires at suse dot cz
                   ` (3 preceding siblings ...)
  2023-12-20  8:19 ` cvs-commit at gcc dot gnu.org
@ 2023-12-21  3:49 ` aoliva at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: aoliva at gcc dot gnu.org @ 2023-12-21  3:49 UTC (permalink / raw)
  To: gcc-bugs

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

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

--- Comment #5 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Fixed

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

end of thread, other threads:[~2023-12-21  3:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-13 19:36 [Bug rtl-optimization/113002] New: ICE in commit_one_edge_insertion, at cfgrtl.cc:2095 with new -finline-stringops mjires at suse dot cz
2023-12-14  9:31 ` [Bug rtl-optimization/113002] " fkastl at suse dot cz
2023-12-20  1:43 ` aoliva at gcc dot gnu.org
2023-12-20  2:07 ` aoliva at gcc dot gnu.org
2023-12-20  8:19 ` cvs-commit at gcc dot gnu.org
2023-12-21  3:49 ` aoliva 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).