public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/103744] New: [12 Regression] ICE in operator[], at vec.h:889
@ 2021-12-16  8:22 asolokha at gmx dot com
  2021-12-16  9:16 ` [Bug tree-optimization/103744] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: asolokha at gmx dot com @ 2021-12-16  8:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103744
           Summary: [12 Regression] ICE in operator[], at vec.h:889
           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/ -mcpu=a64fx -O2:

int r;

void
foo (short int *s, short int *d1, short int *d2, int z)
{
  int *a;

  while (z < 1)
    {
      int i;

      i = *s++ - (*d1++ + *d2++);
      r += a[i];
      i = *s++ - (*d1++ + *d2++);
      r += a[i];
      ++z;
    }
}

% aarch64-linux-gnu-gcc-12.0.0 -mcpu=a64fx -O2 -c utkqjrc1.c
during GIMPLE pass: vect
utkqjrc1.c: In function 'foo':
utkqjrc1.c:4:1: internal compiler error: in operator[], at vec.h:889
    4 | foo (short int *s, short int *d1, short int *d2, int z)
      | ^~~
0x7e1dee vec<edge_def*, va_gc, vl_embed>::operator[](unsigned int)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/vec.h:889
0x7e23c2 vec<gimple*, va_heap, vl_embed>::operator[](unsigned int)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-slp.c:6485
0x7e23c2 vec<gimple*, va_heap, vl_ptr>::operator[](unsigned int)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/vec.h:1495
0x7e23c2 vect_get_slp_vect_def(_slp_tree*, unsigned int)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-slp.c:6482
0x11e0d12 vect_create_epilog_for_reduction
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-loop.c:5325
0x11e0d12 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>*)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-loop.c:8639
0x1c75e67 can_vectorize_live_stmts
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-stmts.c:10899
0x1ca046a 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:11291
0x11fe90a vect_schedule_slp_node
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-slp.c:7270
0x1210e74 vect_schedule_scc
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-slp.c:7514
0x1211eef vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap, vl_ptr>
const&)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-slp.c:7579
0x11ea999 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:9625
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] 10+ messages in thread

* [Bug tree-optimization/103744] [12 Regression] ICE in operator[], at vec.h:889
  2021-12-16  8:22 [Bug tree-optimization/103744] New: [12 Regression] ICE in operator[], at vec.h:889 asolokha at gmx dot com
@ 2021-12-16  9:16 ` pinskia at gcc dot gnu.org
  2021-12-16 10:08 ` marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-16  9:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug tree-optimization/103744] [12 Regression] ICE in operator[], at vec.h:889
  2021-12-16  8:22 [Bug tree-optimization/103744] New: [12 Regression] ICE in operator[], at vec.h:889 asolokha at gmx dot com
  2021-12-16  9:16 ` [Bug tree-optimization/103744] " pinskia at gcc dot gnu.org
@ 2021-12-16 10:08 ` marxin at gcc dot gnu.org
  2021-12-16 10:44 ` [Bug tree-optimization/103744] [12 Regression] ICE in operator[], at vec.h:889 since r12-5612-g10833849b55401a52f2334eb032a70beb688e9fc marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-16 10:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org
           Keywords|                            |needs-bisection

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
I'm bisecting that right now.

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

* [Bug tree-optimization/103744] [12 Regression] ICE in operator[], at vec.h:889 since r12-5612-g10833849b55401a52f2334eb032a70beb688e9fc
  2021-12-16  8:22 [Bug tree-optimization/103744] New: [12 Regression] ICE in operator[], at vec.h:889 asolokha at gmx dot com
  2021-12-16  9:16 ` [Bug tree-optimization/103744] " pinskia at gcc dot gnu.org
  2021-12-16 10:08 ` marxin at gcc dot gnu.org
@ 2021-12-16 10:44 ` marxin at gcc dot gnu.org
  2021-12-16 10:46 ` rsandifo at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-16 10:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-12-16
            Summary|[12 Regression] ICE in      |[12 Regression] ICE in
                   |operator[], at vec.h:889    |operator[], at vec.h:889
                   |                            |since
                   |                            |r12-5612-g10833849b55401a52
                   |                            |f2334eb032a70beb688e9fc
           Keywords|needs-bisection             |
             Status|UNCONFIRMED                 |NEW
                 CC|                            |rsandifo at gcc dot gnu.org

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-5612-g10833849b55401a52f2334eb032a70beb688e9fc.

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

* [Bug tree-optimization/103744] [12 Regression] ICE in operator[], at vec.h:889 since r12-5612-g10833849b55401a52f2334eb032a70beb688e9fc
  2021-12-16  8:22 [Bug tree-optimization/103744] New: [12 Regression] ICE in operator[], at vec.h:889 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2021-12-16 10:44 ` [Bug tree-optimization/103744] [12 Regression] ICE in operator[], at vec.h:889 since r12-5612-g10833849b55401a52f2334eb032a70beb688e9fc marxin at gcc dot gnu.org
@ 2021-12-16 10:46 ` rsandifo at gcc dot gnu.org
  2021-12-17  4:31 ` asolokha at gmx dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2021-12-16 10:46 UTC (permalink / raw)
  To: gcc-bugs

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

rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #3 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
Mine then.

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

* [Bug tree-optimization/103744] [12 Regression] ICE in operator[], at vec.h:889 since r12-5612-g10833849b55401a52f2334eb032a70beb688e9fc
  2021-12-16  8:22 [Bug tree-optimization/103744] New: [12 Regression] ICE in operator[], at vec.h:889 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2021-12-16 10:46 ` rsandifo at gcc dot gnu.org
@ 2021-12-17  4:31 ` asolokha at gmx dot com
  2021-12-17 14:18 ` rsandifo at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: asolokha at gmx dot com @ 2021-12-17  4:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Arseny Solokha <asolokha at gmx dot com> ---
The apparently related case:

short int *s;

int
foo (int r, int z)
{
  int *a;

  while (z < 1)
    {
      int i;

      i = *s;
      s += 2;
      r += a[i];
      r += a[i];
      z += 1;
    }

  return r;
}

% aarch64-linux-gnu-gcc-12.0.0 -mcpu=a64fx -O2 -fno-tree-scev-cprop -c
egbadqtv.c
during GIMPLE pass: vect
egbadqtv.c: In function 'foo':
egbadqtv.c:4:1: internal compiler error: in exact_div, at poly-int.h:2239
    4 | foo (int r, int z)
      | ^~~
0x7dd13e poly_int<2u, poly_result<unsigned long, unsigned long,
poly_coeff_pair_traits<unsigned long, unsigned long>::result_kind>::type>
exact_div<2u, unsigned long, unsigned long>(poly_int_pod<2u, unsigned long>
const&, poly_int_pod<2u, unsigned long> const&)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/poly-int.h:2239
0x7defbe poly_int<2u, poly_result<unsigned long, unsigned long,
poly_coeff_pair_traits<unsigned long, unsigned long>::result_kind>::type>
exact_div<2u, unsigned long, unsigned long>(poly_int_pod<2u, unsigned long>
const&, poly_int_pod<2u, unsigned long> const&)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/poly-int.h:2242
0x7defbe vect_record_loop_mask(_loop_vec_info*, auto_vec<rgroup_controls,
0ul>*, unsigned int, tree_node*, tree_node*)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-loop.c:9060
0x1c978ba vectorizable_load
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-stmts.c:8875
0x1c9fe6a vect_analyze_stmt(vec_info*, _stmt_vec_info*, bool*, _slp_tree*,
_slp_instance*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-stmts.c:11086
0x120b698 vect_slp_analyze_node_operations_1
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-slp.c:4481
0x120b698 vect_slp_analyze_node_operations
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-slp.c:4640
0x120b578 vect_slp_analyze_node_operations
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-slp.c:4620
0x120df26 vect_slp_analyze_operations(vec_info*)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-slp.c:4879
0x11e609e vect_analyze_loop_2
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-loop.c:2412
0x11e7f32 vect_analyze_loop_1
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-loop.c:2830
0x11e84d1 vect_analyze_loop(loop*, vec_info_shared*)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vect-loop.c:2952
0x121e227 try_vectorize_loop_1
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.0_p20211212/work/gcc-12-20211212/gcc/tree-vectorizer.c:1047
0x121e227 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] 10+ messages in thread

* [Bug tree-optimization/103744] [12 Regression] ICE in operator[], at vec.h:889 since r12-5612-g10833849b55401a52f2334eb032a70beb688e9fc
  2021-12-16  8:22 [Bug tree-optimization/103744] New: [12 Regression] ICE in operator[], at vec.h:889 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2021-12-17  4:31 ` asolokha at gmx dot com
@ 2021-12-17 14:18 ` rsandifo at gcc dot gnu.org
  2021-12-17 14:18 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2021-12-17 14:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
(In reply to Arseny Solokha from comment #4)
> The apparently related case:
I think this is actually a separate bug.  Could you open a new PR for it?

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

* [Bug tree-optimization/103744] [12 Regression] ICE in operator[], at vec.h:889 since r12-5612-g10833849b55401a52f2334eb032a70beb688e9fc
  2021-12-16  8:22 [Bug tree-optimization/103744] New: [12 Regression] ICE in operator[], at vec.h:889 asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2021-12-17 14:18 ` rsandifo at gcc dot gnu.org
@ 2021-12-17 14:18 ` cvs-commit at gcc dot gnu.org
  2021-12-17 14:19 ` rsandifo at gcc dot gnu.org
  2021-12-18  4:23 ` asolokha at gmx dot com
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-17 14:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Sandiford <rsandifo@gcc.gnu.org>:

https://gcc.gnu.org/g:e781cb93d7d908f1f4f1611d0034eccbd1478e91

commit r12-6041-ge781cb93d7d908f1f4f1611d0034eccbd1478e91
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Fri Dec 17 14:18:39 2021 +0000

    vect: Fix multi-vector SLP gather loads [PR103744]

    This PR shows that I didn't properly test the multi-vector case when
    adding support for SLP gather loads.  The patch fixes that case using
    the same approach as we do for non-SLP cases: keep the scalar base
    the same, but iterate through the (also multi-vector) vector offsets.
    âvec_num * j + iâ is already used elsewhere as a way of handling both
    the multi-vector SLP case and the multi-vector non-SLP case.

    gcc/
            PR tree-optimization/103744
            * tree-vect-stmts.c (vectorizable_load): Handle multi-vector
            SLP gather loads.

    gcc/testsuite/
            PR tree-optimization/103744
            * gcc.dg/vect/pr103744-1.c: New test.
            * gcc.dg/vect/pr103744-2.c: Likewise.

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

* [Bug tree-optimization/103744] [12 Regression] ICE in operator[], at vec.h:889 since r12-5612-g10833849b55401a52f2334eb032a70beb688e9fc
  2021-12-16  8:22 [Bug tree-optimization/103744] New: [12 Regression] ICE in operator[], at vec.h:889 asolokha at gmx dot com
                   ` (6 preceding siblings ...)
  2021-12-17 14:18 ` cvs-commit at gcc dot gnu.org
@ 2021-12-17 14:19 ` rsandifo at gcc dot gnu.org
  2021-12-18  4:23 ` asolokha at gmx dot com
  8 siblings, 0 replies; 10+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2021-12-17 14:19 UTC (permalink / raw)
  To: gcc-bugs

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

rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> changed:

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

--- Comment #7 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
Fixed.

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

* [Bug tree-optimization/103744] [12 Regression] ICE in operator[], at vec.h:889 since r12-5612-g10833849b55401a52f2334eb032a70beb688e9fc
  2021-12-16  8:22 [Bug tree-optimization/103744] New: [12 Regression] ICE in operator[], at vec.h:889 asolokha at gmx dot com
                   ` (7 preceding siblings ...)
  2021-12-17 14:19 ` rsandifo at gcc dot gnu.org
@ 2021-12-18  4:23 ` asolokha at gmx dot com
  8 siblings, 0 replies; 10+ messages in thread
From: asolokha at gmx dot com @ 2021-12-18  4:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Arseny Solokha <asolokha at gmx dot com> ---
(In reply to rsandifo@gcc.gnu.org from comment #5)
> (In reply to Arseny Solokha from comment #4)
> > The apparently related case:
> I think this is actually a separate bug.  Could you open a new PR for it?

I've just filed PR103761 for that.

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

end of thread, other threads:[~2021-12-18  4:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16  8:22 [Bug tree-optimization/103744] New: [12 Regression] ICE in operator[], at vec.h:889 asolokha at gmx dot com
2021-12-16  9:16 ` [Bug tree-optimization/103744] " pinskia at gcc dot gnu.org
2021-12-16 10:08 ` marxin at gcc dot gnu.org
2021-12-16 10:44 ` [Bug tree-optimization/103744] [12 Regression] ICE in operator[], at vec.h:889 since r12-5612-g10833849b55401a52f2334eb032a70beb688e9fc marxin at gcc dot gnu.org
2021-12-16 10:46 ` rsandifo at gcc dot gnu.org
2021-12-17  4:31 ` asolokha at gmx dot com
2021-12-17 14:18 ` rsandifo at gcc dot gnu.org
2021-12-17 14:18 ` cvs-commit at gcc dot gnu.org
2021-12-17 14:19 ` rsandifo at gcc dot gnu.org
2021-12-18  4:23 ` asolokha at gmx dot com

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