public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/103741] New: [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808
@ 2021-12-16  5:18 asolokha at gmx dot com
  2021-12-16  6:52 ` [Bug tree-optimization/103741] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: asolokha at gmx dot com @ 2021-12-16  5:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103741
           Summary: [12 Regression] ICE in prepare_vec_mask, at
                    tree-vect-stmts.c:1808
           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: aarch64-linux-gnu

gcc 12.0.0 alpha20211212 snapshot (g:0b52083ea2c2dd9897031fdc3802a68fd4aa45ef)
ICEs when compiling the following testcase w/ -march=armv8-a+sve -O1:

long int m, n;

int
qux (int z)
{
  return 4 >> z ? z : 0;
}

int
bar (long int y)
{
  return y ? 3 : 2;
}

__attribute__ ((simd)) int
foo (int x)
{
  long int a = x & m;
  int b = bar (x) / n;

  return qux (b) == a;
}

% aarch64-linux-gnu-gcc-12.0.0 -march=armv8-a+sve -O1 -c et9fimir.c
during GIMPLE pass: vect
et9fimir.c: In function 'foo.simdclone.0':
et9fimir.c:16:1: internal compiler error: in prepare_vec_mask, at
tree-vect-stmts.c:1808
   16 | foo (int x)
      | ^~~
0x8b2dd2 prepare_vec_mask
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-stmts.c:1808
0x1c877d0 vectorizable_operation
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-stmts.c:6372
0x1ca0218 vect_transform_stmt(vec_info*, _stmt_vec_info*,
gimple_stmt_iterator*, _slp_tree*, _slp_instance*)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-stmts.c:11193
0x11cab9d vect_transform_loop_stmt
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-loop.c:9302
0x11e93b5 vect_transform_loop(_loop_vec_info*, gimple*)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-loop.c:9738
0x121e6c7 vect_transform_loops
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vectorizer.c:1003
0x121e6c7 try_vectorize_loop_1
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vectorizer.c:1133
0x121e6c7 try_vectorize_loop
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vectorizer.c:1162
0x121ef74 execute
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vectorizer.c:1278

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

* [Bug tree-optimization/103741] [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808
  2021-12-16  5:18 [Bug tree-optimization/103741] New: [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808 asolokha at gmx dot com
@ 2021-12-16  6:52 ` pinskia at gcc dot gnu.org
  2021-12-16  8:40 ` tnfchris at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-16  6:52 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

* [Bug tree-optimization/103741] [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808
  2021-12-16  5:18 [Bug tree-optimization/103741] New: [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808 asolokha at gmx dot com
  2021-12-16  6:52 ` [Bug tree-optimization/103741] " pinskia at gcc dot gnu.org
@ 2021-12-16  8:40 ` tnfchris at gcc dot gnu.org
  2021-12-16  8:43 ` tnfchris at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-12-16  8:40 UTC (permalink / raw)
  To: gcc-bugs

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

Tamar Christina <tnfchris at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-12-16
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |tnfchris at gcc dot gnu.org
                 CC|                            |tnfchris at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
           Priority|P3                          |P1

--- Comment #1 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
probably mine..

the assert

gcc_assert (useless_type_conversion_p (mask_type, TREE_TYPE (vec_mask)));

is failing but the types are the same

>>> p (TREE_TYPE (loop_mask))
$2 = (tree) 0x7fdf174631f8

>>> dbgtree ($2)
 <vector_type 0x7fdf174631f8
    type <boolean_type 0x7fdf17463150 QI
        size <integer_cst 0x7fdf1757cf00 constant 8>
        unit-size <integer_cst 0x7fdf1757cf18 constant 1>
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fdf17463150 precision:8 min <integer_cst 0x7fdf17477fd8 -128> max
<integer_cst 0x7fdf1747c030 127>>
    VNx2BI
    size <poly_int_cst 0x7fdf173e0ea0
        type <integer_type 0x7fdf175940a8 bitsizetype public unsigned TI
            size <integer_cst 0x7fdf1757ce58 constant 128>
            unit-size <integer_cst 0x7fdf1757ce70 constant 16>
            align:128 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fdf175940a8 precision:128 min <integer_cst 0x7fdf1757ce88 0> max
<integer_cst 0x7fdf17586898 0xffffffffffffffffffffffffffffffff>>
        constant
        elt0: <integer_cst 0x7fdf1757cfc0 constant 16> elt1: <integer_cst
0x7fdf1757cfc0 16>>
    unit-size <poly_int_cst 0x7fdf173e0e60
        type <integer_type 0x7fdf17594000 sizetype public unsigned DI
            size <integer_cst 0x7fdf1757ce10 constant 64>
            unit-size <integer_cst 0x7fdf1757ce28 constant 8>
            align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fdf17594000 precision:64 min <integer_cst 0x7fdf1757ce40 0> max <integer_cst
0x7fdf1757d5e0 18446744073709551615>>
        constant
        elt0: <integer_cst 0x7fdf1757cfd8 constant 2> elt1: <integer_cst
0x7fdf1757cfd8 2>>
    align:16 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fdf174631f8 nunits:[2,2]>
>>> dbgtree (mask_type)
 <vector_type 0x7fdf174631f8
    type <boolean_type 0x7fdf17463150 QI
        size <integer_cst 0x7fdf1757cf00 constant 8>
        unit-size <integer_cst 0x7fdf1757cf18 constant 1>
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fdf17463150 precision:8 min <integer_cst 0x7fdf17477fd8 -128> max
<integer_cst 0x7fdf1747c030 127>>
    VNx2BI
    size <poly_int_cst 0x7fdf173e0ea0
        type <integer_type 0x7fdf175940a8 bitsizetype public unsigned TI
            size <integer_cst 0x7fdf1757ce58 constant 128>
            unit-size <integer_cst 0x7fdf1757ce70 constant 16>
            align:128 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fdf175940a8 precision:128 min <integer_cst 0x7fdf1757ce88 0> max
<integer_cst 0x7fdf17586898 0xffffffffffffffffffffffffffffffff>>
        constant
        elt0: <integer_cst 0x7fdf1757cfc0 constant 16> elt1: <integer_cst
0x7fdf1757cfc0 16>>
    unit-size <poly_int_cst 0x7fdf173e0e60
        type <integer_type 0x7fdf17594000 sizetype public unsigned DI
            size <integer_cst 0x7fdf1757ce10 constant 64>
            unit-size <integer_cst 0x7fdf1757ce28 constant 8>
            align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fdf17594000 precision:64 min <integer_cst 0x7fdf1757ce40 0> max <integer_cst
0x7fdf1757d5e0 18446744073709551615>>
        constant
        elt0: <integer_cst 0x7fdf1757cfd8 constant 2> elt1: <integer_cst
0x7fdf1757cfd8 2>>
    align:16 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fdf174631f8 nunits:[2,2]>

So need to see why useless_type_conversion_p thinks they are not.

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

* [Bug tree-optimization/103741] [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808
  2021-12-16  5:18 [Bug tree-optimization/103741] New: [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808 asolokha at gmx dot com
  2021-12-16  6:52 ` [Bug tree-optimization/103741] " pinskia at gcc dot gnu.org
  2021-12-16  8:40 ` tnfchris at gcc dot gnu.org
@ 2021-12-16  8:43 ` tnfchris at gcc dot gnu.org
  2021-12-16 11:15 ` [Bug tree-optimization/103741] [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808 since r12-5772-g06f2e7d49fc6341ea0128ccd83fd13705dd2c523 marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-12-16  8:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
AH!

 <ssa_name 0x7fdf17474ee8
    type <vector_type 0x7fdf17400690
        type <integer_type 0x7fdf17594738 long int sizes-gimplified public DI
            size <integer_cst 0x7fdf1757ce10 constant 64>
            unit-size <integer_cst 0x7fdf1757ce28 constant 8>
            align:64 warn_if_not_align:0 symtab:0 alias-set 1 canonical-type
0x7fdf17594738 precision:64 min <integer_cst 0x7fdf175980a8
-9223372036854775808> max <integer_cst 0x7fdf175980c0 9223372036854775807>
            pointer_to_this <pointer_type 0x7fdf175a3c78>>
        VNx2DI
        size <poly_int_cst 0x7fdf173e0f00 type <integer_type 0x7fdf175940a8
bitsizetype>
            constant
            elt0: <integer_cst 0x7fdf1757ce58 constant 128> elt1: <integer_cst
0x7fdf1757ce58 128>>
        unit-size <poly_int_cst 0x7fdf173e0ee0 type <integer_type
0x7fdf17594000 sizetype>
            constant
            elt0: <integer_cst 0x7fdf1757ce70 constant 16> elt1: <integer_cst
0x7fdf1757ce70 16>>
        align:128 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fdf17400690 nunits:[2,2]>
    var <var_decl 0x7fdf17460ab0 vect__2.35>
    def_stmt vect__2.35_68 = [vec_unpack_lo_expr] vect_x_1.34_67;
    version:68>

That is most definitely not a mask..

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

* [Bug tree-optimization/103741] [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808 since r12-5772-g06f2e7d49fc6341ea0128ccd83fd13705dd2c523
  2021-12-16  5:18 [Bug tree-optimization/103741] New: [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2021-12-16  8:43 ` tnfchris at gcc dot gnu.org
@ 2021-12-16 11:15 ` marxin at gcc dot gnu.org
  2021-12-16 14:42 ` tnfchris at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-16 11:15 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|needs-bisection             |
            Summary|[12 Regression] ICE in      |[12 Regression] ICE in
                   |prepare_vec_mask, at        |prepare_vec_mask, at
                   |tree-vect-stmts.c:1808      |tree-vect-stmts.c:1808
                   |                            |since
                   |                            |r12-5772-g06f2e7d49fc6341ea
                   |                            |0128ccd83fd13705dd2c523

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Just for the record, started with just
r12-5772-g06f2e7d49fc6341ea0128ccd83fd13705dd2c523.

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

* [Bug tree-optimization/103741] [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808 since r12-5772-g06f2e7d49fc6341ea0128ccd83fd13705dd2c523
  2021-12-16  5:18 [Bug tree-optimization/103741] New: [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2021-12-16 11:15 ` [Bug tree-optimization/103741] [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808 since r12-5772-g06f2e7d49fc6341ea0128ccd83fd13705dd2c523 marxin at gcc dot gnu.org
@ 2021-12-16 14:42 ` tnfchris at gcc dot gnu.org
  2021-12-17 11:00 ` cvs-commit at gcc dot gnu.org
  2021-12-17 11:01 ` tnfchris at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-12-16 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Patch missing a check on vec_mode, testing a fix.

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

* [Bug tree-optimization/103741] [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808 since r12-5772-g06f2e7d49fc6341ea0128ccd83fd13705dd2c523
  2021-12-16  5:18 [Bug tree-optimization/103741] New: [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2021-12-16 14:42 ` tnfchris at gcc dot gnu.org
@ 2021-12-17 11:00 ` cvs-commit at gcc dot gnu.org
  2021-12-17 11:01 ` tnfchris at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-17 11:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tamar Christina <tnfchris@gcc.gnu.org>:

https://gcc.gnu.org/g:411ac94611f164fac7ec1cd5953549c0a56cf43a

commit r12-6038-g411ac94611f164fac7ec1cd5953549c0a56cf43a
Author: Tamar Christina <tamar.christina@arm.com>
Date:   Fri Dec 17 10:59:25 2021 +0000

    slp: check that the operation we're combing is a boolean operation
[PR103741]

    It seems I forgot to check that the operation we're combing when masking
the
    predicated together are actually predicates types.

    Without it we end up accidentally trying to combine a value and a mask.

    gcc/ChangeLog:

            PR tree-optimization/103741
            * tree-vect-stmts.c (vectorizable_operation): Check for boolean.

    gcc/testsuite/ChangeLog:

            PR tree-optimization/103741
            * gcc.target/aarch64/pr103741.c: New test.

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

* [Bug tree-optimization/103741] [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808 since r12-5772-g06f2e7d49fc6341ea0128ccd83fd13705dd2c523
  2021-12-16  5:18 [Bug tree-optimization/103741] New: [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808 asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2021-12-17 11:00 ` cvs-commit at gcc dot gnu.org
@ 2021-12-17 11:01 ` tnfchris at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-12-17 11:01 UTC (permalink / raw)
  To: gcc-bugs

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

Tamar Christina <tnfchris at gcc dot gnu.org> changed:

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

--- Comment #6 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
fixed on trunk, thanks for the report!

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

end of thread, other threads:[~2021-12-17 11:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16  5:18 [Bug tree-optimization/103741] New: [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808 asolokha at gmx dot com
2021-12-16  6:52 ` [Bug tree-optimization/103741] " pinskia at gcc dot gnu.org
2021-12-16  8:40 ` tnfchris at gcc dot gnu.org
2021-12-16  8:43 ` tnfchris at gcc dot gnu.org
2021-12-16 11:15 ` [Bug tree-optimization/103741] [12 Regression] ICE in prepare_vec_mask, at tree-vect-stmts.c:1808 since r12-5772-g06f2e7d49fc6341ea0128ccd83fd13705dd2c523 marxin at gcc dot gnu.org
2021-12-16 14:42 ` tnfchris at gcc dot gnu.org
2021-12-17 11:00 ` cvs-commit at gcc dot gnu.org
2021-12-17 11:01 ` tnfchris 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).