public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/99656] New: ICE in linear_loads_p
@ 2021-03-19  4:33 asolokha at gmx dot com
  2021-03-19  8:08 ` [Bug tree-optimization/99656] [11 Regression] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: asolokha at gmx dot com @ 2021-03-19  4:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99656
           Summary: ICE in linear_loads_p
           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: asolokha at gmx dot com
  Target Milestone: ---
            Target: aarch64-linux-gnu

gfortran-11.0.1-alpha2021031 snapshot
(g:c2d7c39fcb8a3cb67600cdb6fde49ecb0e951589)  ICEs when compiling the following
testcase w/ -march=armv8.3-a -O1 -ftree-slp-vectorize -fwrapv:

      SUBROUTINE ZLAHQR2(H, LDH, H22, T1)

      INTEGER            LDH
      COMPLEX*16         H(LDH, *)

      INTEGER            NR
      COMPLEX*16         H22, SUM, T1, V2

      COMPLEX*16         V( 3 )

      EXTERNAL           ZLARFG
      INTRINSIC          DCONJG

      V2 = H22 
      CALL ZLARFG(T1)
      SUM = DCONJG(T1) * H(1, 1)
      H(1, 1) = SUM * V2

      RETURN
      END

% aarch64-linux-gnu-gfortran-11.0.1 -march=armv8.3-a -O1 -ftree-slp-vectorize
-fwrapv -c dimduxtl.f
during GIMPLE pass: slp
dimduxtl.f:1:24:

    1 |       SUBROUTINE ZLAHQR2(H, LDH, H22, T1)
      |                        ^
internal compiler error: Segmentation fault
0xf06aaf crash_signal
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/toplev.c:327
0x11d04e3 vec<unsigned int, va_heap, vl_embed>::operator[](unsigned int)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/vec.h:890
0x11d04e3 vec<unsigned int, va_heap, vl_ptr>::operator[](unsigned int)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/vec.h:1461
0x11d04e3 linear_loads_p
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/tree-vect-slp-patterns.c:258
0x11d03c6 linear_loads_p
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/tree-vect-slp-patterns.c:242
0x11d143c complex_mul_pattern::matches(_complex_operation, hash_map<_slp_tree*,
std::pair<_complex_perm_kinds, vec<unsigned int, va_heap, vl_ptr> >,
simple_hashmap_traits<default_hash_traits<_slp_tree*>,
std::pair<_complex_perm_kinds, vec<unsigned int, va_heap, vl_ptr> > > >*,
_slp_tree**, vec<_slp_tree*, va_heap, vl_ptr>*)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/tree-vect-slp-patterns.c:1006
0x11d1bb0 complex_mul_pattern::matches(_complex_operation, hash_map<_slp_tree*,
std::pair<_complex_perm_kinds, vec<unsigned int, va_heap, vl_ptr> >,
simple_hashmap_traits<default_hash_traits<_slp_tree*>,
std::pair<_complex_perm_kinds, vec<unsigned int, va_heap, vl_ptr> > > >*,
_slp_tree**, vec<_slp_tree*, va_heap, vl_ptr>*)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/tree-vect-slp-patterns.c:991
0x11d1bb0 complex_operations_pattern::recognize(hash_map<_slp_tree*,
std::pair<_complex_perm_kinds, vec<unsigned int, va_heap, vl_ptr> >,
simple_hashmap_traits<default_hash_traits<_slp_tree*>,
std::pair<_complex_perm_kinds, vec<unsigned int, va_heap, vl_ptr> > > >*,
_slp_tree**)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/tree-vect-slp-patterns.c:1491
0x11c235c vect_match_slp_patterns_2
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/tree-vect-slp.c:2427
0x11c2330 vect_match_slp_patterns_2
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/tree-vect-slp.c:2422
0x11c63cf vect_match_slp_patterns
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/tree-vect-slp.c:2458
0x11c63cf vect_analyze_slp(vec_info*, unsigned int)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/tree-vect-slp.c:2901
0x11ca92c vect_slp_analyze_bb_1
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/tree-vect-slp.c:4820
0x11ca92c vect_slp_region
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/tree-vect-slp.c:4932
0x11ca92c vect_slp_bbs
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/tree-vect-slp.c:5082
0x11cc74c vect_slp_function(function*)
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/tree-vect-slp.c:5168
0x11d2a02 execute
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-11.0.1_alpha20210314/work/gcc-11-20210314/gcc/tree-vectorizer.c:1450

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

* [Bug tree-optimization/99656] [11 Regression] ICE in linear_loads_p
  2021-03-19  4:33 [Bug tree-optimization/99656] New: ICE in linear_loads_p asolokha at gmx dot com
@ 2021-03-19  8:08 ` rguenth at gcc dot gnu.org
  2021-03-19  9:09 ` tnfchris at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-03-19  8:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
            Summary|ICE in linear_loads_p       |[11 Regression] ICE in
                   |                            |linear_loads_p
     Ever confirmed|0                           |1
                 CC|                            |rguenth at gcc dot gnu.org,
                   |                            |tnfchris at gcc dot gnu.org
   Target Milestone|---                         |11.0
   Last reconfirmed|                            |2021-03-19
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  -fwrapv is not needed

#2  0x000000000183e03e in linear_loads_p (perm_cache=0x7fffffffd080, 
    root=0x355a838) at ../../src/trunk/gcc/tree-vect-slp-patterns.c:258
258             nloads[i] = all_loads[perm[i].first][perm[i].second];
(gdb) p debug(root)
t.f90:1:24: note: node 0x355a838 (max_nunits=1, refcnt=1)
t.f90:1:24: note: op: VEC_PERM_EXPR
t.f90:1:24: note:       { }
t.f90:1:24: note:       lane permutation { 0[0] 1[1] }
t.f90:1:24: note:       children 0x3559f30 0x355a0c8
$1 = void

(gdb) p debug ((slp_tree)0x3559f30)
t.f90:1:24: note: node 0x3559f30 (max_nunits=2, refcnt=4)
t.f90:1:24: note: op template: _16 = REALPART_EXPR <*t1_9(D)>;
t.f90:1:24: note:       stmt 0 _16 = REALPART_EXPR <*t1_9(D)>;
t.f90:1:24: note:       stmt 1 _16 = REALPART_EXPR <*t1_9(D)>;
t.f90:1:24: note:       load permutation { 0 0 }
$8 = void
(gdb) p debug ((slp_tree)0x355a0c8)
t.f90:1:24: note: node (external) 0x355a0c8 (max_nunits=1, refcnt=2)
t.f90:1:24: note:       { _18, _18 }
$9 = void

so one child doesn't have a load permutation.  Looks like we merge
PERM_TOP and PERM_EVENEVEN as PERM_EVENEVEN but for the PERM_TOP
child we then record NULL into all_loads.

Tamar?

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

* [Bug tree-optimization/99656] [11 Regression] ICE in linear_loads_p
  2021-03-19  4:33 [Bug tree-optimization/99656] New: ICE in linear_loads_p asolokha at gmx dot com
  2021-03-19  8:08 ` [Bug tree-optimization/99656] [11 Regression] " rguenth at gcc dot gnu.org
@ 2021-03-19  9:09 ` tnfchris at gcc dot gnu.org
  2021-03-19 10:58 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-03-19  9:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |tnfchris at gcc dot gnu.org

--- Comment #2 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
I'll take a look, thanks!

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

* [Bug tree-optimization/99656] [11 Regression] ICE in linear_loads_p
  2021-03-19  4:33 [Bug tree-optimization/99656] New: ICE in linear_loads_p asolokha at gmx dot com
  2021-03-19  8:08 ` [Bug tree-optimization/99656] [11 Regression] " rguenth at gcc dot gnu.org
  2021-03-19  9:09 ` tnfchris at gcc dot gnu.org
@ 2021-03-19 10:58 ` jakub at gcc dot gnu.org
  2021-03-19 14:31 ` cvs-commit at gcc dot gnu.org
  2021-03-19 14:38 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-03-19 10:58 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started to ICE with r11-6734-gad2603433853129e847cade5e269c6a5f889a020

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

* [Bug tree-optimization/99656] [11 Regression] ICE in linear_loads_p
  2021-03-19  4:33 [Bug tree-optimization/99656] New: ICE in linear_loads_p asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2021-03-19 10:58 ` jakub at gcc dot gnu.org
@ 2021-03-19 14:31 ` cvs-commit at gcc dot gnu.org
  2021-03-19 14:38 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-19 14:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

commit r11-7736-gc3a2bc6daaa2d278cb5f323e2df4b8c2af4198ac
Author: Tamar Christina <tamar.christina@arm.com>
Date:   Fri Mar 19 14:29:36 2021 +0000

    slp: remove unneeded permute calculation (PR99656)

    The attach testcase ICEs because as you showed on the PR we have one child
    which is an internal with a PERM of EVENEVEN and one with TOP.

    The problem is while we can conceptually merge the permute itself into
EVENEVEN,
    merging the lanes don't really make sense.

    That said, we no longer even require the merged lanes as we create the
permutes
    based on the KIND directly.

    This patch just removes all of that code.

    Unfortunately it still won't vectorize with the cost model enabled due to
the
    blend that's created combining the load and the external

            note: node 0x51f2ce8 (max_nunits=1, refcnt=1)
            note: op: VEC_PERM_EXPR
            note:       { }
            note:       lane permutation { 0[0] 1[1] }
            note:       children 0x51f23e0 0x51f2578
            note: node 0x51f23e0 (max_nunits=2, refcnt=1)
            note: op template: _16 = REALPART_EXPR <*t1_9(D)>;
            note:       stmt 0 _16 = REALPART_EXPR <*t1_9(D)>;
            note:       stmt 1 _16 = REALPART_EXPR <*t1_9(D)>;
            note:       load permutation { 0 0 }
            note: node (external) 0x51f2578 (max_nunits=1, refcnt=1)
            note:       { _18, _18 }

    which costs the cost for the load-and-split and the cost of the external
splat,
    and the one for blending them while in reality it's just a scalar load and
    insert.

    The compiler (with the cost model disabled) generates

            ldr     q1, [x19]
            dup     v1.2d, v1.d[0]
            ldr     d0, [x19, 8]
            fneg    d0, d0
            ins     v1.d[1], v0.d[0]

    while really it should be

            ldp     d1, d0, [x19]
            fneg    d0, d0
            ins     v1.d[1], v0.d[0]

    but that's for another time.

    gcc/ChangeLog:

            PR tree-optimization/99656
            * tree-vect-slp-patterns.c (linear_loads_p,
            complex_add_pattern::matches, is_eq_or_top,
            vect_validate_multiplication, complex_mul_pattern::matches,
            complex_fms_pattern::matches): Remove complex_perm_kinds_t.
            * tree-vectorizer.h: (complex_load_perm_t): Removed.
            (slp_tree_to_load_perm_map_t): Use complex_perm_kinds_t instead of
            complex_load_perm_t.

    gcc/testsuite/ChangeLog:

            PR tree-optimization/99656
            * gfortran.dg/vect/pr99656.f90: New test.

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

* [Bug tree-optimization/99656] [11 Regression] ICE in linear_loads_p
  2021-03-19  4:33 [Bug tree-optimization/99656] New: ICE in linear_loads_p asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2021-03-19 14:31 ` cvs-commit at gcc dot gnu.org
@ 2021-03-19 14:38 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-03-19 14:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2021-03-19 14:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19  4:33 [Bug tree-optimization/99656] New: ICE in linear_loads_p asolokha at gmx dot com
2021-03-19  8:08 ` [Bug tree-optimization/99656] [11 Regression] " rguenth at gcc dot gnu.org
2021-03-19  9:09 ` tnfchris at gcc dot gnu.org
2021-03-19 10:58 ` jakub at gcc dot gnu.org
2021-03-19 14:31 ` cvs-commit at gcc dot gnu.org
2021-03-19 14:38 ` 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).