public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/97173] New: [11 Regression] ICE in vectorizable_live_operation, at tree-vect-loop.c:8324 since r11-3025-g095d42feed09f880
@ 2020-09-23  7:41 marxin at gcc dot gnu.org
  2020-09-23  7:42 ` [Bug tree-optimization/97173] " marxin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-09-23  7:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97173
           Summary: [11 Regression] ICE in vectorizable_live_operation, at
                    tree-vect-loop.c:8324 since r11-3025-g095d42feed09f880
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: rguenth at gcc dot gnu.org
  Target Milestone: ---

The following ICEs:

$ cat disk.i
typedef struct {
  char *track;
  char *clocks;
  char *fm;
  char *weak;  
} disk_t;

disk_t disk_update_tlens_d;
int disk_update_tlens_d_0;

void disk_update_tlens() {
  disk_update_tlens_d.track = disk_update_tlens_d.clocks =
      disk_update_tlens_d.track + disk_update_tlens_d_0;
  disk_update_tlens_d.fm = disk_update_tlens_d.clocks + disk_update_tlens_d_0;
  disk_update_tlens_d.weak = disk_update_tlens_d.fm;
  disk_update_tlens_d.track[2] = 5;
}

$ gcc disk.i -c -O3
during GIMPLE pass: slp
disk.i: In function ‘disk_update_tlens’:
disk.i:11:6: internal compiler error: in vectorizable_live_operation, at
tree-vect-loop.c:8348
   11 | void disk_update_tlens() {
      |      ^~~~~~~~~~~~~~~~~
0x729e91 vectorizable_live_operation(vec_info*, _stmt_vec_info*,
gimple_stmt_iterator*, _slp_tree*, _slp_instance*, int, bool,
vec<stmt_info_for_cost, va_heap, vl_ptr>*)
        /home/marxin/Programming/gcc/gcc/tree-vect-loop.c:8348
0xfd1217 can_vectorize_live_stmts
        /home/marxin/Programming/gcc/gcc/tree-vect-stmts.c:10531
0xff6878 vect_transform_stmt(vec_info*, _stmt_vec_info*, gimple_stmt_iterator*,
_slp_tree*, _slp_instance*)
        /home/marxin/Programming/gcc/gcc/tree-vect-stmts.c:10909
0x1022d69 vect_schedule_slp_instance
        /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:4717
0x1022d86 vect_schedule_slp_instance
        /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:4583
0x102bee1 vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap, vl_ptr>)
        /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:4840
0x102d448 vect_slp_region
        /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:3676
0x102d448 vect_slp_bb(basic_block_def*)
        /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:3793
0x102fa6f execute
        /home/marxin/Programming/gcc/gcc/tree-vectorizer.c:1433
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.

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

* [Bug tree-optimization/97173] [11 Regression] ICE in vectorizable_live_operation, at tree-vect-loop.c:8324 since r11-3025-g095d42feed09f880
  2020-09-23  7:41 [Bug tree-optimization/97173] New: [11 Regression] ICE in vectorizable_live_operation, at tree-vect-loop.c:8324 since r11-3025-g095d42feed09f880 marxin at gcc dot gnu.org
@ 2020-09-23  7:42 ` marxin at gcc dot gnu.org
  2020-09-23  8:06 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-09-23  7:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |11.0
      Known to work|                            |10.2.0
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-09-23
     Ever confirmed|0                           |1
   Target Milestone|---                         |11.0

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

* [Bug tree-optimization/97173] [11 Regression] ICE in vectorizable_live_operation, at tree-vect-loop.c:8324 since r11-3025-g095d42feed09f880
  2020-09-23  7:41 [Bug tree-optimization/97173] New: [11 Regression] ICE in vectorizable_live_operation, at tree-vect-loop.c:8324 since r11-3025-g095d42feed09f880 marxin at gcc dot gnu.org
  2020-09-23  7:42 ` [Bug tree-optimization/97173] " marxin at gcc dot gnu.org
@ 2020-09-23  8:06 ` rguenth at gcc dot gnu.org
  2020-09-23  8:42 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-09-23  8:06 UTC (permalink / raw)
  To: gcc-bugs

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

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 #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.

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

* [Bug tree-optimization/97173] [11 Regression] ICE in vectorizable_live_operation, at tree-vect-loop.c:8324 since r11-3025-g095d42feed09f880
  2020-09-23  7:41 [Bug tree-optimization/97173] New: [11 Regression] ICE in vectorizable_live_operation, at tree-vect-loop.c:8324 since r11-3025-g095d42feed09f880 marxin at gcc dot gnu.org
  2020-09-23  7:42 ` [Bug tree-optimization/97173] " marxin at gcc dot gnu.org
  2020-09-23  8:06 ` rguenth at gcc dot gnu.org
@ 2020-09-23  8:42 ` rguenth at gcc dot gnu.org
  2020-09-23 10:19 ` cvs-commit at gcc dot gnu.org
  2020-09-23 10:19 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-09-23  8:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
t.i:12:29: note:   node 0x53dcd70 (max_nunits=2, refcnt=2)
t.i:12:29: note:        stmt 0 _4 = _1 + _3;
t.i:12:29: note:        stmt 1 _4 = _1 + _3;
t.i:12:29: note:        stmt 2 _5 = _4 + _3;
t.i:12:29: note:        stmt 3 _5 = _4 + _3;
t.i:12:29: note:        children 0x5578e20 0x53de920
t.i:12:29: note:   node (external) 0x5578e20 (max_nunits=1, refcnt=1)
t.i:12:29: note:        { _1, _1, _4, _4 }
t.i:12:29: note:   node (external) 0x53de920 (max_nunits=1, refcnt=1)
t.i:12:29: note:        { _3, _3, _3, _3 }

hmm, another case of a "weird" SLP grouping (the 0x53dcd70 node computes
some operand lanes itself, _4 = _1 + 3).  We're also getting the costing
wrong here and think _1 + _3 can be eliminated.  Now the code tries to exactly
catch this case:

            /* ???  This can happen when the live lane ends up being
               used in a vector construction code-generated by an
               external SLP node (and code-generation for that already
               happened).  See gcc.dg/vect/bb-slp-47.c.
               Doing this is what would happen if that vector CTOR
               were not code-generated yet so it is not too bad.
               ???  In fact we'd likely want to avoid this situation
               in the first place.  */
            if (gimple_code (use_stmt) != GIMPLE_PHI
                && !vect_stmt_dominates_stmt_p (gsi_stmt (*gsi), use_stmt))
              {
                gcc_assert (is_gimple_assign (use_stmt)
                            && gimple_assign_rhs_code (use_stmt) ==
CONSTRUCTOR)

but the assert fails to consider the case where the CTOR elements need to be
converted (here pointer to unsigned long) and thus the use_stmts are
not the CTOR but the conversion.

Of course as the comment says we likely want to avoid this situation and
instead
elide 0x53dcd70 to be external itself.

For now I'm going to adjust the assert.

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

* [Bug tree-optimization/97173] [11 Regression] ICE in vectorizable_live_operation, at tree-vect-loop.c:8324 since r11-3025-g095d42feed09f880
  2020-09-23  7:41 [Bug tree-optimization/97173] New: [11 Regression] ICE in vectorizable_live_operation, at tree-vect-loop.c:8324 since r11-3025-g095d42feed09f880 marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-09-23  8:42 ` rguenth at gcc dot gnu.org
@ 2020-09-23 10:19 ` cvs-commit at gcc dot gnu.org
  2020-09-23 10:19 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-23 10:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:52e5b3fd8ef1d1b3ff86e26bd0aa7266bd9767fd

commit r11-3391-g52e5b3fd8ef1d1b3ff86e26bd0aa7266bd9767fd
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Sep 23 10:42:48 2020 +0200

    tree-optimization/97173 - extend assert in vectorizable_live_operation

    The condition we're expecting to eventually run into isn't fully
    captured by checking for CTORs, instead we can also run into the
    CTOR element conversion.

    2020-09-23  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/97173
            * tree-vect-loop.c (vectorizable_live_operation): Extend
            assert to also conver element conversions.

            * gcc.dg/vect/pr97173.c: New testcase.

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

* [Bug tree-optimization/97173] [11 Regression] ICE in vectorizable_live_operation, at tree-vect-loop.c:8324 since r11-3025-g095d42feed09f880
  2020-09-23  7:41 [Bug tree-optimization/97173] New: [11 Regression] ICE in vectorizable_live_operation, at tree-vect-loop.c:8324 since r11-3025-g095d42feed09f880 marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-09-23 10:19 ` cvs-commit at gcc dot gnu.org
@ 2020-09-23 10:19 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-09-23 10:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2020-09-23 10:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-23  7:41 [Bug tree-optimization/97173] New: [11 Regression] ICE in vectorizable_live_operation, at tree-vect-loop.c:8324 since r11-3025-g095d42feed09f880 marxin at gcc dot gnu.org
2020-09-23  7:42 ` [Bug tree-optimization/97173] " marxin at gcc dot gnu.org
2020-09-23  8:06 ` rguenth at gcc dot gnu.org
2020-09-23  8:42 ` rguenth at gcc dot gnu.org
2020-09-23 10:19 ` cvs-commit at gcc dot gnu.org
2020-09-23 10:19 ` 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).