public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/98133] New: ICE in vectorizable_conversion, at tree-vect-stmts.c:4690
@ 2020-12-04  5:55 marxin at gcc dot gnu.org
  2020-12-04  7:19 ` [Bug tree-optimization/98133] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-04  5:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98133
           Summary: ICE in vectorizable_conversion, at
                    tree-vect-stmts.c:4690
           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, rsandifo at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-linux
            Target: aarch64-linux-gnu

The following fails:

$ g++ /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/vect/pr96022.cc -Ofast
--param=max-completely-peeled-insns=0 -fno-tree-loop-im -fno-tree-pre -c
during GIMPLE pass: vect
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/vect/pr96022.cc: In function
‘void test(short int, bool, int)’:
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/vect/pr96022.cc:6:6: internal
compiler error: in vectorizable_conversion, at tree-vect-stmts.c:4690
    6 | void test(short a, bool, int p8) {
      |      ^~~~
0x6a2afb vectorizable_conversion
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/tree-vect-stmts.c:4690
0xf08773 vect_analyze_stmt(vec_info*, _stmt_vec_info*, bool*, _slp_tree*,
_slp_instance*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/tree-vect-stmts.c:10694
0xf23c08 vect_analyze_loop_operations
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/tree-vect-loop.c:1758
0xf23c08 vect_analyze_loop_2
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/tree-vect-loop.c:2478
0xf23c08 vect_analyze_loop(loop*, vec_info_shared*)
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/tree-vect-loop.c:2925
0xf48321 try_vectorize_loop_1
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/tree-vectorizer.c:995
0xf48d19 vectorize_loops()
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/tree-vectorizer.c:1229
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/98133] ICE in vectorizable_conversion, at tree-vect-stmts.c:4690
  2020-12-04  5:55 [Bug tree-optimization/98133] New: ICE in vectorizable_conversion, at tree-vect-stmts.c:4690 marxin at gcc dot gnu.org
@ 2020-12-04  7:19 ` rguenth at gcc dot gnu.org
  2020-12-04  7:39 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-12-04  7:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

* [Bug tree-optimization/98133] ICE in vectorizable_conversion, at tree-vect-stmts.c:4690
  2020-12-04  5:55 [Bug tree-optimization/98133] New: ICE in vectorizable_conversion, at tree-vect-stmts.c:4690 marxin at gcc dot gnu.org
  2020-12-04  7:19 ` [Bug tree-optimization/98133] " rguenth at gcc dot gnu.org
@ 2020-12-04  7:39 ` rguenth at gcc dot gnu.org
  2020-12-04  7:39 ` [Bug tree-optimization/98133] [11 Regression] " 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-12-04  7:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
                 CC|                            |joel.hutton at arm dot com
           Assignee|rguenth at gcc dot gnu.org         |unassigned at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
#5  0x00000000019c9eeb in vectorizable_conversion (vinfo=0x3985f80, 
    stmt_info=0x39c0f70, gsi=0x0, vec_stmt=0x0, slp_node=0x0, 
    cost_vec=0x7fffffffc4f8) at ../../src/trunk/gcc/tree-vect-stmts.c:4686
4686        ncopies = vect_get_num_copies (loop_vinfo, vectype_in);
(gdb) p debug_generic_expr (vectype_in)
vector(8) short int
$1 = void
(gdb) p loop_vinfo->vectorization_factor 
$2 = {<poly_int_pod<2, unsigned long>> = {coeffs = {4, 0}}, <No data fields>}

that can't work.

(gdb) p debug_gimple_stmt (stmt_info->stmt)
patt_10 = (a_15(D)) <<< ??? >>> (-30574);

the TREE_CODE of this is WIDEN_PLUS_EXPR (we seem to miss an entry for
tree_code_name and pretty-printing for this ... so much for using new
tree-codes).

vectorizable_conversion has

  code = gimple_assign_rhs_code (stmt);
  if (!CONVERT_EXPR_CODE_P (code)
      && code != FIX_TRUNC_EXPR
      && code != FLOAT_EXPR
      && code != WIDEN_PLUS_EXPR
      && code != WIDEN_MINUS_EXPR
      && code != WIDEN_MULT_EXPR
      && code != WIDEN_LSHIFT_EXPR)
    return false;

so it's supposed to handle this case.  I think the special-case is that
the whole stmt is invariant and thus not participating in determining
the vectorization factor (all ops are invariant).  So we're running into

  /* If op0 is an external or constant def, infer the vector type
     from the scalar type.  */
  if (!vectype_in)
    vectype_in = get_vectype_for_scalar_type (vinfo, rhs_type, slp_node);

now we should always be able to use vectype_out for determining ncopies,
we just have to correctly interpret it for WIDEN/NARROW or adjust it.

Leaving to arm folks to resolve.

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

* [Bug tree-optimization/98133] [11 Regression] ICE in vectorizable_conversion, at tree-vect-stmts.c:4690
  2020-12-04  5:55 [Bug tree-optimization/98133] New: ICE in vectorizable_conversion, at tree-vect-stmts.c:4690 marxin at gcc dot gnu.org
  2020-12-04  7:19 ` [Bug tree-optimization/98133] " rguenth at gcc dot gnu.org
  2020-12-04  7:39 ` rguenth at gcc dot gnu.org
@ 2020-12-04  7:39 ` rguenth at gcc dot gnu.org
  2021-01-14 13:51 ` joelh at gcc dot gnu.org
  2021-01-14 13:53 ` joelh at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-12-04  7:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE in                      |[11 Regression] ICE in
                   |vectorizable_conversion, at |vectorizable_conversion, at
                   |tree-vect-stmts.c:4690      |tree-vect-stmts.c:4690
           Priority|P3                          |P1
   Target Milestone|---                         |11.0

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

* [Bug tree-optimization/98133] [11 Regression] ICE in vectorizable_conversion, at tree-vect-stmts.c:4690
  2020-12-04  5:55 [Bug tree-optimization/98133] New: ICE in vectorizable_conversion, at tree-vect-stmts.c:4690 marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-12-04  7:39 ` [Bug tree-optimization/98133] [11 Regression] " rguenth at gcc dot gnu.org
@ 2021-01-14 13:51 ` joelh at gcc dot gnu.org
  2021-01-14 13:53 ` joelh at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: joelh at gcc dot gnu.org @ 2021-01-14 13:51 UTC (permalink / raw)
  To: gcc-bugs

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

Joel Hutton <joelh at gcc dot gnu.org> changed:

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

--- Comment #3 from Joel Hutton <joelh at gcc dot gnu.org> ---
This is fixed on trunk, I believe this is a duplicate of PR97929. 

Fixed on trunk with r11-5903-gf5b902a9af9d1cce6c540c7f71e02e22e45c23ef

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

* [Bug tree-optimization/98133] [11 Regression] ICE in vectorizable_conversion, at tree-vect-stmts.c:4690
  2020-12-04  5:55 [Bug tree-optimization/98133] New: ICE in vectorizable_conversion, at tree-vect-stmts.c:4690 marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-01-14 13:51 ` joelh at gcc dot gnu.org
@ 2021-01-14 13:53 ` joelh at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: joelh at gcc dot gnu.org @ 2021-01-14 13:53 UTC (permalink / raw)
  To: gcc-bugs

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

Joel Hutton <joelh at gcc dot gnu.org> changed:

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

--- Comment #4 from Joel Hutton <joelh at gcc dot gnu.org> ---
Fixed on trunk, appears to be a duplicate of PR97929

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

end of thread, other threads:[~2021-01-14 13:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04  5:55 [Bug tree-optimization/98133] New: ICE in vectorizable_conversion, at tree-vect-stmts.c:4690 marxin at gcc dot gnu.org
2020-12-04  7:19 ` [Bug tree-optimization/98133] " rguenth at gcc dot gnu.org
2020-12-04  7:39 ` rguenth at gcc dot gnu.org
2020-12-04  7:39 ` [Bug tree-optimization/98133] [11 Regression] " rguenth at gcc dot gnu.org
2021-01-14 13:51 ` joelh at gcc dot gnu.org
2021-01-14 13:53 ` joelh 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).