public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/102827] New: [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19)
@ 2021-10-19  7:05 asolokha at gmx dot com
  2021-10-19  7:35 ` [Bug tree-optimization/102827] [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19) since r12-4398-g9b2ad21ab3ebc21a marxin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: asolokha at gmx dot com @ 2021-10-19  7:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102827
           Summary: [12 Regression] ICE: verify_ssa failed (error:
                    definition in block 20 does not dominate use in block
                    19)
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: x86_64-pc-linux-gnu

gcc-12.0.0-alpha20211017 snapshot (g:5d4d64faa71a6389bfb76bfb3334b63360cf62c0)
ICEs when compiling the following testcase, reduced from
gcc/testsuite/gcc.target/aarch64/sve/vcond_4_run.c, w/ -mavx -O1
-ftree-parallelize-loops=2 -ftree-vectorize --param ssa-name-def-chain-limit=2:

void
test_double_double_nugt_var (double *restrict dest, double *restrict src,
                             int b, int i)
{
  while (i < 1)
    {
      dest[i] = b ? src[i] : 0.0;
      ++i;
    }
}

% x86_64-pc-linux-gnu-gcc-12.0.0 -mavx -O1 -ftree-parallelize-loops=2
-ftree-vectorize --param ssa-name-def-chain-limit=2 -c e4ykrgkb.c
e4ykrgkb.c: In function 'test_double_double_nugt_var._loopfn.0':
e4ykrgkb.c:5:12: error: definition in block 20 does not dominate use in block
19
    5 |   while (i < 1)
      |            ^
for SSA_NAME: _46 in statement:
_71 = _46 + _70;
during GIMPLE pass: vect
e4ykrgkb.c:5:12: internal compiler error: verify_ssa failed
0x10d79e3 verify_ssa(bool, bool)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211017/work/gcc-12-20211017/gcc/tree-ssa.c:1214
0xdaa655 execute_function_todo
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211017/work/gcc-12-20211017/gcc/passes.c:2049
0xdaaf6c execute_todo
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211017/work/gcc-12-20211017/gcc/passes.c:2096

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

* [Bug tree-optimization/102827] [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19) since r12-4398-g9b2ad21ab3ebc21a
  2021-10-19  7:05 [Bug tree-optimization/102827] New: [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19) asolokha at gmx dot com
@ 2021-10-19  7:35 ` marxin at gcc dot gnu.org
  2021-10-19  7:43 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-10-19  7:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
            Summary|[12 Regression] ICE:        |[12 Regression] ICE:
                   |verify_ssa failed (error:   |verify_ssa failed (error:
                   |definition in block 20 does |definition in block 20 does
                   |not dominate use in block   |not dominate use in block
                   |19)                         |19) since
                   |                            |r12-4398-g9b2ad21ab3ebc21a
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-10-19
   Target Milestone|---                         |12.0
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-4398-g9b2ad21ab3ebc21a.

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

* [Bug tree-optimization/102827] [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19) since r12-4398-g9b2ad21ab3ebc21a
  2021-10-19  7:05 [Bug tree-optimization/102827] New: [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19) asolokha at gmx dot com
  2021-10-19  7:35 ` [Bug tree-optimization/102827] [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19) since r12-4398-g9b2ad21ab3ebc21a marxin at gcc dot gnu.org
@ 2021-10-19  7:43 ` rguenth at gcc dot gnu.org
  2021-10-19  8:24 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-10-19  7:43 UTC (permalink / raw)
  To: gcc-bugs

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

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> ---
Mine.

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

* [Bug tree-optimization/102827] [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19) since r12-4398-g9b2ad21ab3ebc21a
  2021-10-19  7:05 [Bug tree-optimization/102827] New: [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19) asolokha at gmx dot com
  2021-10-19  7:35 ` [Bug tree-optimization/102827] [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19) since r12-4398-g9b2ad21ab3ebc21a marxin at gcc dot gnu.org
  2021-10-19  7:43 ` rguenth at gcc dot gnu.org
@ 2021-10-19  8:24 ` rguenth at gcc dot gnu.org
  2021-10-19 10:29 ` cvs-commit at gcc dot gnu.org
  2021-10-19 10:30 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-10-19  8:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
The following reproduces the issue with -O -mavx -ftree-vectorize --param
ssa-name-def-chain-limit=0

The issue is that split_constant_offset doesn't see through the conversion
in that case and the vectorizer inserts the alias test before where
if-conversion
inserted the invariant stmt.  Basically the vectorizer assumes there's
no defs (that end up being used) between the .LOOP_VECTORIZED test and the loop
header.

Now the --param is somewhat of a red herring and if-conversion only requires
an _extra_ length of the chain of 1 (but we might be close to the limit from
in-loop uses).

void
test_double_double_nugt_var (double *dest, double *src, int b, int i)
{
  while (i < 1)
    {
      dest[i] = b ? src[i] : 0.0;
      ++i;
    }
}

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

* [Bug tree-optimization/102827] [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19) since r12-4398-g9b2ad21ab3ebc21a
  2021-10-19  7:05 [Bug tree-optimization/102827] New: [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19) asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2021-10-19  8:24 ` rguenth at gcc dot gnu.org
@ 2021-10-19 10:29 ` cvs-commit at gcc dot gnu.org
  2021-10-19 10:30 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-19 10:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 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:d996799a507f9f4c379b55b004233be92fa63380

commit r12-4498-gd996799a507f9f4c379b55b004233be92fa63380
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Oct 19 10:19:12 2021 +0200

    tree-optimization/102827 - avoid stmts in preheader

    The PR shows that when carefully crafting the runtime alias
    condition in the vectorizer we might end up using defs from
    the loop preheader but will end up inserting the condition
    before the .LOOP_VECTORIZED call.  So the following makes
    sure to insert invariants before that when we versioned the
    loop, preserving the invariant the vectorizer relies on.

    2021-10-19  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/102827
            * tree-if-conv.c (predicate_statements): Add pe parameter
            and use that edge to insert invariant stmts on.
            (combine_blocks): Pass through pe.
            (tree_if_conversion): Compute the edge to insert invariant
            stmts on and pass it along.

            * gcc.dg/pr102827.c: New testcase.

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

* [Bug tree-optimization/102827] [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19) since r12-4398-g9b2ad21ab3ebc21a
  2021-10-19  7:05 [Bug tree-optimization/102827] New: [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19) asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2021-10-19 10:29 ` cvs-commit at gcc dot gnu.org
@ 2021-10-19 10:30 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-10-19 10:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2021-10-19 10:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19  7:05 [Bug tree-optimization/102827] New: [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19) asolokha at gmx dot com
2021-10-19  7:35 ` [Bug tree-optimization/102827] [12 Regression] ICE: verify_ssa failed (error: definition in block 20 does not dominate use in block 19) since r12-4398-g9b2ad21ab3ebc21a marxin at gcc dot gnu.org
2021-10-19  7:43 ` rguenth at gcc dot gnu.org
2021-10-19  8:24 ` rguenth at gcc dot gnu.org
2021-10-19 10:29 ` cvs-commit at gcc dot gnu.org
2021-10-19 10:30 ` 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).