public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/97559] New: ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed
@ 2020-10-24  8:07 su at cs dot ucdavis.edu
  2020-10-26  7:56 ` [Bug tree-optimization/97559] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: su at cs dot ucdavis.edu @ 2020-10-24  8:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97559
           Summary: ICE at -O1 and above on x86_64-pc-linux-gnu:
                    verify_ssa failed
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

[566] % 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/11.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 11.0.0 20201024 (experimental) [master revision
d0e2ffcca0e:78f21910dde:a29ff9c53a77b6e208350d8c6db0f3e988f61d1f] (GCC) 
[567] % 
[567] % gcctk -O0 -c small.c
[568] % 
[568] % gcctk -O1 -c small.c
small.c: In function ‘e’:
small.c:5:6: error: stmt with wrong VUSE
    5 | void e () {
      |      ^
# VUSE <.MEM_8(D)>
f_9 = a;
expected .MEM_5
during GIMPLE pass: sink
small.c:5:6: internal compiler error: verify_ssa failed
0xf6887b verify_ssa(bool, bool)
        ../../gcc-trunk/gcc/tree-ssa.c:1208
0xbf6e07 execute_function_todo
        ../../gcc-trunk/gcc/passes.c:1999
0xbf7bb2 execute_todo
        ../../gcc-trunk/gcc/passes.c:2046
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.
[569] % 
[569] % cat small.c
int printf (char *, ...);

int a, b, c, d;

void e () {
  int f = a;
  if (b) {
  L1:
    b = 0;
  L2:
    if (c) {
      if (f)
        printf("0");
      goto L1;
    }
  }
  if (d)
    goto L2;
}

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

* [Bug tree-optimization/97559] ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed
  2020-10-24  8:07 [Bug tree-optimization/97559] New: ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed su at cs dot ucdavis.edu
@ 2020-10-26  7:56 ` rguenth at gcc dot gnu.org
  2020-10-26  8:27 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-26  7:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-10-26

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I will have a look.

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

* [Bug tree-optimization/97559] ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed
  2020-10-24  8:07 [Bug tree-optimization/97559] New: ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed su at cs dot ucdavis.edu
  2020-10-26  7:56 ` [Bug tree-optimization/97559] " rguenth at gcc dot gnu.org
@ 2020-10-26  8:27 ` rguenth at gcc dot gnu.org
  2020-10-26 10:05 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-26  8:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, so as expected this is

static bool
statement_sink_location (gimple *stmt, basic_block frombb,
                         gimple_stmt_iterator *togsi, bool *zero_uses_p)
{
...
      /* If this is a load then do not sink past any stores.
         Look for virtual definitions in the path from frombb to the sink
         location computed from the real uses and if found, adjust
         that it a common dominator.  */
      if (gimple_vuse (stmt))
        {
...
          FOR_EACH_IMM_USE_FAST (use_p, imm_iter, gimple_vuse (stmt))
            {
...
                  /* In case the PHI node post-dominates the current insert
location
                     we can disregard it.  But make sure it is not dominating
                     it as well as can happen in a CFG cycle.  */
                  if (commondom != bb
                      && !dominated_by_p (CDI_DOMINATORS, commondom, bb)
                      && dominated_by_p (CDI_POST_DOMINATORS, commondom, bb))
                    continue;

where the use stmt is in an irreducible region and thus the dominance
check breaks down.  We want to avoid doing a full 'is use_stmt' on a
path from bb to commondom check and thus are employing some heuristics
to capture most cases.  We do have natural loops computed here and
irreducible regions marked, need to think about an adjustment to the above.

Meanwhile more testcases are always welcome.

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

* [Bug tree-optimization/97559] ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed
  2020-10-24  8:07 [Bug tree-optimization/97559] New: ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed su at cs dot ucdavis.edu
  2020-10-26  7:56 ` [Bug tree-optimization/97559] " rguenth at gcc dot gnu.org
  2020-10-26  8:27 ` rguenth at gcc dot gnu.org
@ 2020-10-26 10:05 ` marxin at gcc dot gnu.org
  2020-10-26 10:32 ` [Bug tree-optimization/97559] [11 Regression] " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-26 10:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |10.2.0
      Known to fail|                            |11.0
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Btw. started with r11-3705-gdae673abd37d4004.

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

* [Bug tree-optimization/97559] [11 Regression] ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed
  2020-10-24  8:07 [Bug tree-optimization/97559] New: ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed su at cs dot ucdavis.edu
                   ` (2 preceding siblings ...)
  2020-10-26 10:05 ` marxin at gcc dot gnu.org
@ 2020-10-26 10:32 ` jakub at gcc dot gnu.org
  2020-11-03 21:09 ` zhendong.su at inf dot ethz.ch
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-10-26 10:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE at -O1 and above on     |[11 Regression] ICE at -O1
                   |x86_64-pc-linux-gnu:        |and above on
                   |verify_ssa failed           |x86_64-pc-linux-gnu:
                   |                            |verify_ssa failed
                 CC|                            |jakub at gcc dot gnu.org
           Priority|P3                          |P1
   Target Milestone|---                         |11.0

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

* [Bug tree-optimization/97559] [11 Regression] ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed
  2020-10-24  8:07 [Bug tree-optimization/97559] New: ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed su at cs dot ucdavis.edu
                   ` (3 preceding siblings ...)
  2020-10-26 10:32 ` [Bug tree-optimization/97559] [11 Regression] " jakub at gcc dot gnu.org
@ 2020-11-03 21:09 ` zhendong.su at inf dot ethz.ch
  2020-12-08  9:36 ` cvs-commit at gcc dot gnu.org
  2020-12-08  9:37 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2020-11-03 21:09 UTC (permalink / raw)
  To: gcc-bugs

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

Zhendong Su <zhendong.su at inf dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zhendong.su at inf dot ethz.ch

--- Comment #4 from Zhendong Su <zhendong.su at inf dot ethz.ch> ---
Another repro for the same ICE (but only at -Os):

[541] % gcctk -O1 -c small.c
[542] % gcctk -O2 -c small.c
[543] % gcctk -O3 -c small.c
[544] %
[544] % gcctk -Os -c small.c
small.c: In function ‘e’:
small.c:3:6: error: stmt with wrong VUSE
    3 | void e() {
      |      ^
# VUSE <.MEM_7(D)>
f_8 = b;
expected .MEM_5
during GIMPLE pass: sink
small.c:3:6: internal compiler error: verify_ssa failed
0xf707cb verify_ssa(bool, bool)
        ../../gcc-trunk/gcc/tree-ssa.c:1208
0xbfe3e7 execute_function_todo
        ../../gcc-trunk/gcc/passes.c:2046
0xbff192 execute_todo
        ../../gcc-trunk/gcc/passes.c:2093
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.
[545] %
[545] % cat small.c
int a, b, c, d;

void e() {
  int f = b;
  if (a) {
  L1:
    a = 0;
  L2:
    if (a) {
      c = b;
      goto L1;
    }
  }
  if (d)
    goto L2;
}

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

* [Bug tree-optimization/97559] [11 Regression] ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed
  2020-10-24  8:07 [Bug tree-optimization/97559] New: ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed su at cs dot ucdavis.edu
                   ` (4 preceding siblings ...)
  2020-11-03 21:09 ` zhendong.su at inf dot ethz.ch
@ 2020-12-08  9:36 ` cvs-commit at gcc dot gnu.org
  2020-12-08  9:37 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-08  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:a294e6368f80ac27c5150414027d1cf2a21bd9b7

commit r11-5840-ga294e6368f80ac27c5150414027d1cf2a21bd9b7
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Dec 8 09:45:57 2020 +0100

    tree-optimization/97559 - fix sinking in irreducible regions

    This fixes sinking of loads when irreducible regions are involved
    and the heuristics to find stores on the path along the sink
    breaks down since that uses dominator queries.

    2020-12-08  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/97559
            * tree-ssa-sink.c (statement_sink_location): Never ignore
            PHIs on sink paths in irreducible regions.

            * gcc.dg/torture/pr97559-1.c: New testcase.
            * gcc.dg/torture/pr97559-2.c: Likewise.

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

* [Bug tree-optimization/97559] [11 Regression] ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed
  2020-10-24  8:07 [Bug tree-optimization/97559] New: ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed su at cs dot ucdavis.edu
                   ` (5 preceding siblings ...)
  2020-12-08  9:36 ` cvs-commit at gcc dot gnu.org
@ 2020-12-08  9:37 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-12-08  9:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2020-12-08  9:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-24  8:07 [Bug tree-optimization/97559] New: ICE at -O1 and above on x86_64-pc-linux-gnu: verify_ssa failed su at cs dot ucdavis.edu
2020-10-26  7:56 ` [Bug tree-optimization/97559] " rguenth at gcc dot gnu.org
2020-10-26  8:27 ` rguenth at gcc dot gnu.org
2020-10-26 10:05 ` marxin at gcc dot gnu.org
2020-10-26 10:32 ` [Bug tree-optimization/97559] [11 Regression] " jakub at gcc dot gnu.org
2020-11-03 21:09 ` zhendong.su at inf dot ethz.ch
2020-12-08  9:36 ` cvs-commit at gcc dot gnu.org
2020-12-08  9:37 ` 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).