public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/101202] New: ICE at -O3 on x86_64-linux-gnu: Segmentation fault
@ 2021-06-24 21:45 zhendong.su at inf dot ethz.ch
  2021-06-25  6:24 ` [Bug tree-optimization/101202] " rguenth at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2021-06-24 21:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101202
           Summary: ICE at -O3 on x86_64-linux-gnu: Segmentation fault
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

This seems to be a very recent regression.

[529] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++
--disable-werror --enable-multilib --with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210624 (experimental) [master revision
a0accaa9984:cc7f2982315:ce3316e9c02c81c509173572c71a101f4eb62a24] (GCC) 
[530] % 
[530] % gcctk -O2 small.c; ./a.out
[531] % 
[531] % gcctk -O3 small.c
during GIMPLE pass: slp
small.c: In function ‘main’:
small.c:4:5: internal compiler error: Segmentation fault
    4 | int main() {
      |     ^~~~
0xdb35cf crash_signal
        ../../gcc-trunk/gcc/toplev.c:327
0x10cf440 vect_optimize_slp(vec_info*)
        ../../gcc-trunk/gcc/tree-vect-slp.c:3694
0x10d7d77 vect_optimize_slp(vec_info*)
        ../../gcc-trunk/gcc/vec.h:1448
0x10d7d77 vect_slp_analyze_bb_1
        ../../gcc-trunk/gcc/tree-vect-slp.c:5608
0x10d7d77 vect_slp_region
        ../../gcc-trunk/gcc/tree-vect-slp.c:5695
0x10d9a0a vect_slp_bbs
        ../../gcc-trunk/gcc/tree-vect-slp.c:5845
0x10d9f4c vect_slp_function(function*)
        ../../gcc-trunk/gcc/tree-vect-slp.c:5931
0x10e12a6 execute
        ../../gcc-trunk/gcc/tree-vectorizer.c:1445
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
[532] % 
[532] % cat small.c
int printf(const char *, ...);
unsigned a, b, d;
int c, e, f;
int main() {
  while (a)
    if (b) {
      f = a;
      while (e) {
        int h, i;
        if (d) {
          h = a;
          i = d;
        L:
          d = a | d && c;
          if (a) {
            printf("%d", a);
            goto L;
          }
        }
        a = h;
        d = i;
      }
    }
  return 0;
}

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

* [Bug tree-optimization/101202] ICE at -O3 on x86_64-linux-gnu: Segmentation fault
  2021-06-24 21:45 [Bug tree-optimization/101202] New: ICE at -O3 on x86_64-linux-gnu: Segmentation fault zhendong.su at inf dot ethz.ch
@ 2021-06-25  6:24 ` rguenth at gcc dot gnu.org
  2021-06-25  6:43 ` marxin at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-25  6:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-06-25
            Version|unknown                     |12.0
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.

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

* [Bug tree-optimization/101202] ICE at -O3 on x86_64-linux-gnu: Segmentation fault
  2021-06-24 21:45 [Bug tree-optimization/101202] New: ICE at -O3 on x86_64-linux-gnu: Segmentation fault zhendong.su at inf dot ethz.ch
  2021-06-25  6:24 ` [Bug tree-optimization/101202] " rguenth at gcc dot gnu.org
@ 2021-06-25  6:43 ` marxin at gcc dot gnu.org
  2021-06-25  6:47 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-25  6:43 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Just for the record: started with r12-1769-g82ab14927651e0ea.

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

* [Bug tree-optimization/101202] ICE at -O3 on x86_64-linux-gnu: Segmentation fault
  2021-06-24 21:45 [Bug tree-optimization/101202] New: ICE at -O3 on x86_64-linux-gnu: Segmentation fault zhendong.su at inf dot ethz.ch
  2021-06-25  6:24 ` [Bug tree-optimization/101202] " rguenth at gcc dot gnu.org
  2021-06-25  6:43 ` marxin at gcc dot gnu.org
@ 2021-06-25  6:47 ` rguenth at gcc dot gnu.org
  2021-06-25  6:49 ` dcb314 at hotmail dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-25  6:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So we still have failed backedge destinations in the SLP graph, those have
vect_uninitialized_def and the

-         /* For leafs there's nothing to do - we've seeded permutes
-            on those above.  */
-         if (SLP_TREE_DEF_TYPE (node) != vect_internal_def)
+
+         /* Handle externals and constants optimistically throughout the
+            iteration.  */
+         if (SLP_TREE_DEF_TYPE (node) == vect_external_def
+             || SLP_TREE_DEF_TYPE (node) == vect_constant_def)

change exposed them.  We do represent them in the graph though, and treating
them optimistically is not exactly correct.  Just propagating across them
might be better, OTOH the PHI is going to be promoted external.

I think it would be much better to not keep those during optimize_slp ...

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

* [Bug tree-optimization/101202] ICE at -O3 on x86_64-linux-gnu: Segmentation fault
  2021-06-24 21:45 [Bug tree-optimization/101202] New: ICE at -O3 on x86_64-linux-gnu: Segmentation fault zhendong.su at inf dot ethz.ch
                   ` (2 preceding siblings ...)
  2021-06-25  6:47 ` rguenth at gcc dot gnu.org
@ 2021-06-25  6:49 ` dcb314 at hotmail dot com
  2021-06-25  7:23 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dcb314 at hotmail dot com @ 2021-06-25  6:49 UTC (permalink / raw)
  To: gcc-bugs

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

David Binderman <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcb314 at hotmail dot com

--- Comment #4 from David Binderman <dcb314 at hotmail dot com> ---
I see this also on gcc bootstrap with -O3, so it looks quite important.

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

* [Bug tree-optimization/101202] ICE at -O3 on x86_64-linux-gnu: Segmentation fault
  2021-06-24 21:45 [Bug tree-optimization/101202] New: ICE at -O3 on x86_64-linux-gnu: Segmentation fault zhendong.su at inf dot ethz.ch
                   ` (3 preceding siblings ...)
  2021-06-25  6:49 ` dcb314 at hotmail dot com
@ 2021-06-25  7:23 ` rguenth at gcc dot gnu.org
  2021-06-25  7:30 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-25  7:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to David Binderman from comment #4)
> I see this also on gcc bootstrap with -O3, so it looks quite important.

I'll see to test the patch with -O3 bootstrap then - thanks for the info.

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

* [Bug tree-optimization/101202] ICE at -O3 on x86_64-linux-gnu: Segmentation fault
  2021-06-24 21:45 [Bug tree-optimization/101202] New: ICE at -O3 on x86_64-linux-gnu: Segmentation fault zhendong.su at inf dot ethz.ch
                   ` (4 preceding siblings ...)
  2021-06-25  7:23 ` rguenth at gcc dot gnu.org
@ 2021-06-25  7:30 ` marxin at gcc dot gnu.org
  2021-06-25  7:36 ` dcb314 at hotmail dot com
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-25  7:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
And I noticed the same ICE in botan benchmark.

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

* [Bug tree-optimization/101202] ICE at -O3 on x86_64-linux-gnu: Segmentation fault
  2021-06-24 21:45 [Bug tree-optimization/101202] New: ICE at -O3 on x86_64-linux-gnu: Segmentation fault zhendong.su at inf dot ethz.ch
                   ` (5 preceding siblings ...)
  2021-06-25  7:30 ` marxin at gcc dot gnu.org
@ 2021-06-25  7:36 ` dcb314 at hotmail dot com
  2021-06-25 10:03 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dcb314 at hotmail dot com @ 2021-06-25  7:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Richard Biener from comment #5)
> I'll see to test the patch with -O3 bootstrap then - thanks for the info.

You are very welcome.

With the benefit of hindsight, changes in the -O3 area of the compiler
would be well tested before commit with one of

1. bootstrap-O3
2. After a configure command, doing something like this:

sed 's/-O2/-O3/' < Makefile > Makefile.tmp
diff Makefile Makefile.tmp
mv Makefile.tmp Makefile

I am not sure of the difference, but they are pretty similar.

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

* [Bug tree-optimization/101202] ICE at -O3 on x86_64-linux-gnu: Segmentation fault
  2021-06-24 21:45 [Bug tree-optimization/101202] New: ICE at -O3 on x86_64-linux-gnu: Segmentation fault zhendong.su at inf dot ethz.ch
                   ` (6 preceding siblings ...)
  2021-06-25  7:36 ` dcb314 at hotmail dot com
@ 2021-06-25 10:03 ` cvs-commit at gcc dot gnu.org
  2021-06-25 10:04 ` rguenth at gcc dot gnu.org
  2021-06-28  7:00 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-25 10:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS 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:55a1546b73b60d2601f35671ba9e8f12a52a7b77

commit r12-1809-g55a1546b73b60d2601f35671ba9e8f12a52a7b77
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Jun 25 09:20:56 2021 +0200

    tree-optimization/101202 - fix ICE with failed backedge SLP nodes

    This fixes an ICE with failed backedge SLP nodes still in the graph
    while doing permute optimization by explicitely handling those.

    2021-06-25  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/101202
            * tree-vect-slp.c (vect_optimize_slp): Explicitely handle
            failed nodes.

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

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

* [Bug tree-optimization/101202] ICE at -O3 on x86_64-linux-gnu: Segmentation fault
  2021-06-24 21:45 [Bug tree-optimization/101202] New: ICE at -O3 on x86_64-linux-gnu: Segmentation fault zhendong.su at inf dot ethz.ch
                   ` (7 preceding siblings ...)
  2021-06-25 10:03 ` cvs-commit at gcc dot gnu.org
@ 2021-06-25 10:04 ` rguenth at gcc dot gnu.org
  2021-06-28  7:00 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-25 10:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

* [Bug tree-optimization/101202] ICE at -O3 on x86_64-linux-gnu: Segmentation fault
  2021-06-24 21:45 [Bug tree-optimization/101202] New: ICE at -O3 on x86_64-linux-gnu: Segmentation fault zhendong.su at inf dot ethz.ch
                   ` (8 preceding siblings ...)
  2021-06-25 10:04 ` rguenth at gcc dot gnu.org
@ 2021-06-28  7:00 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-28  7:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cnsun at uwaterloo dot ca

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
*** Bug 101218 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2021-06-28  7:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-24 21:45 [Bug tree-optimization/101202] New: ICE at -O3 on x86_64-linux-gnu: Segmentation fault zhendong.su at inf dot ethz.ch
2021-06-25  6:24 ` [Bug tree-optimization/101202] " rguenth at gcc dot gnu.org
2021-06-25  6:43 ` marxin at gcc dot gnu.org
2021-06-25  6:47 ` rguenth at gcc dot gnu.org
2021-06-25  6:49 ` dcb314 at hotmail dot com
2021-06-25  7:23 ` rguenth at gcc dot gnu.org
2021-06-25  7:30 ` marxin at gcc dot gnu.org
2021-06-25  7:36 ` dcb314 at hotmail dot com
2021-06-25 10:03 ` cvs-commit at gcc dot gnu.org
2021-06-25 10:04 ` rguenth at gcc dot gnu.org
2021-06-28  7:00 ` rguenth 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).