public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/103977] New: ice in try_vectorize_loop_1
@ 2022-01-11 12:10 dcb314 at hotmail dot com
  2022-01-11 12:17 ` [Bug tree-optimization/103977] " jakub at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: dcb314 at hotmail dot com @ 2022-01-11 12:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103977
           Summary: ice in try_vectorize_loop_1
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 52163
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52163&action=edit
gzipped C source code

The attached C code does this:

$ /home/dcb/gcc/results/bin/gcc  -c -w   -std=gnu89  -mno-sse -mno-mmx   -O3 
bug785.c
during GIMPLE pass: vect
mm/slab_common.c: In function ‘cache_random_seq_create’:
mm/slab_common.c:992:5: internal compiler error: in operator[], at vec.h:889
0x10367ab vect_analyze_loop(loop*, vec_info_shared*)
        ../../trunk.git/gcc/tree-vect-loop.c:0
0x1082487 try_vectorize_loop_1(hash_table<simduid_to_vf, false, xcallocator>*&,
unsigned int*, loop*, gimple*, gimple*, function*)
        ../../trunk.git/gcc/tree-vectorizer.c:1047
0x1082487 try_vectorize_loop(hash_table<simduid_to_vf, false, xcallocator>*&,
unsigned int*, loop*, function*)
        ../../trunk.git/gcc/tree-vectorizer.c:1162

Code derived from the Linux kernel.

I will have a go at reducing the code.

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

* [Bug tree-optimization/103977] ice in try_vectorize_loop_1
  2022-01-11 12:10 [Bug c/103977] New: ice in try_vectorize_loop_1 dcb314 at hotmail dot com
@ 2022-01-11 12:17 ` jakub at gcc dot gnu.org
  2022-01-11 12:43 ` [Bug tree-optimization/103977] [12 Regression] ice in try_vectorize_loop_1 since r12-6420-gd3ff7420e941931d32ce2e332e7968fe67ba20af dcb314 at hotmail dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-11 12:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |tree-optimization
   Target Milestone|---                         |12.0
     Ever confirmed|0                           |1
                 CC|                            |avieira at gcc dot gnu.org,
                   |                            |jakub at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
           Priority|P3                          |P1
   Last reconfirmed|                            |2022-01-11

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r12-6420-gd3ff7420e941931d32ce2e332e7968fe67ba20af

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

* [Bug tree-optimization/103977] [12 Regression] ice in try_vectorize_loop_1 since r12-6420-gd3ff7420e941931d32ce2e332e7968fe67ba20af
  2022-01-11 12:10 [Bug c/103977] New: ice in try_vectorize_loop_1 dcb314 at hotmail dot com
  2022-01-11 12:17 ` [Bug tree-optimization/103977] " jakub at gcc dot gnu.org
@ 2022-01-11 12:43 ` dcb314 at hotmail dot com
  2022-01-11 12:59 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dcb314 at hotmail dot com @ 2022-01-11 12:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from David Binderman <dcb314 at hotmail dot com> ---
Reduced C source code is

int *freelist_randomize_list;
int cache_random_seq_create_count_i;
void cache_random_seq_create_count() {
  for (; cache_random_seq_create_count_i; cache_random_seq_create_count_i++)
    freelist_randomize_list[cache_random_seq_create_count_i] =
        cache_random_seq_create_count_i;
}

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

* [Bug tree-optimization/103977] [12 Regression] ice in try_vectorize_loop_1 since r12-6420-gd3ff7420e941931d32ce2e332e7968fe67ba20af
  2022-01-11 12:10 [Bug c/103977] New: ice in try_vectorize_loop_1 dcb314 at hotmail dot com
  2022-01-11 12:17 ` [Bug tree-optimization/103977] " jakub at gcc dot gnu.org
  2022-01-11 12:43 ` [Bug tree-optimization/103977] [12 Regression] ice in try_vectorize_loop_1 since r12-6420-gd3ff7420e941931d32ce2e332e7968fe67ba20af dcb314 at hotmail dot com
@ 2022-01-11 12:59 ` rguenth at gcc dot gnu.org
  2022-01-11 23:30 ` law at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-11 12:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
  /* For epilogues start the analysis from the first mode.  The motivation
     behind starting from the beginning comes from cases where the VECTOR_MODES
     array may contain length-agnostic and length-specific modes.  Their
     ordering is not guaranteed, so we could end up picking a mode for the main
     loop that is after the epilogue's optimal mode.  */
  mode_i = 1;

that's only valid if vector_modes.length () > 1 but for the testcase it only
contains the artificial VOIDmode aka autodetect mode.  I wonder why
we don't start from 0?

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

* [Bug tree-optimization/103977] [12 Regression] ice in try_vectorize_loop_1 since r12-6420-gd3ff7420e941931d32ce2e332e7968fe67ba20af
  2022-01-11 12:10 [Bug c/103977] New: ice in try_vectorize_loop_1 dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2022-01-11 12:59 ` rguenth at gcc dot gnu.org
@ 2022-01-11 23:30 ` law at gcc dot gnu.org
  2022-01-12 10:20 ` avieira at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: law at gcc dot gnu.org @ 2022-01-11 23:30 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

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

--- Comment #4 from Jeffrey A. Law <law at gcc dot gnu.org> ---
FWIW, the patch Jakub identified is causing similar testsuite regressions
across ~30 targets at this point.

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

* [Bug tree-optimization/103977] [12 Regression] ice in try_vectorize_loop_1 since r12-6420-gd3ff7420e941931d32ce2e332e7968fe67ba20af
  2022-01-11 12:10 [Bug c/103977] New: ice in try_vectorize_loop_1 dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2022-01-11 23:30 ` law at gcc dot gnu.org
@ 2022-01-12 10:20 ` avieira at gcc dot gnu.org
  2022-01-12 16:04 ` law at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: avieira at gcc dot gnu.org @ 2022-01-12 10:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from avieira at gcc dot gnu.org ---
Posted a fix on ML:
https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588237.html

Sorry for the breakage, wrong assumption by my part :(

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

* [Bug tree-optimization/103977] [12 Regression] ice in try_vectorize_loop_1 since r12-6420-gd3ff7420e941931d32ce2e332e7968fe67ba20af
  2022-01-11 12:10 [Bug c/103977] New: ice in try_vectorize_loop_1 dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2022-01-12 10:20 ` avieira at gcc dot gnu.org
@ 2022-01-12 16:04 ` law at gcc dot gnu.org
  2022-01-12 16:10 ` avieira at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: law at gcc dot gnu.org @ 2022-01-12 16:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jeffrey A. Law <law at gcc dot gnu.org> ---
And just to follow-up.  With the patch that was committed to the trunk, the 30+
targets that were previously failing are now working.

A few are still building, but I expect them to succeed.  mips* is failing, but
I suspect it's the recent allocator changes, not the vectorizer changes causing
problems.

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

* [Bug tree-optimization/103977] [12 Regression] ice in try_vectorize_loop_1 since r12-6420-gd3ff7420e941931d32ce2e332e7968fe67ba20af
  2022-01-11 12:10 [Bug c/103977] New: ice in try_vectorize_loop_1 dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2022-01-12 16:04 ` law at gcc dot gnu.org
@ 2022-01-12 16:10 ` avieira at gcc dot gnu.org
  2022-01-12 16:17 ` avieira at gcc dot gnu.org
  2022-01-13  7:13 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: avieira at gcc dot gnu.org @ 2022-01-12 16:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from avieira at gcc dot gnu.org ---
Thanks for confirming that Jeff :)

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

* [Bug tree-optimization/103977] [12 Regression] ice in try_vectorize_loop_1 since r12-6420-gd3ff7420e941931d32ce2e332e7968fe67ba20af
  2022-01-11 12:10 [Bug c/103977] New: ice in try_vectorize_loop_1 dcb314 at hotmail dot com
                   ` (6 preceding siblings ...)
  2022-01-12 16:10 ` avieira at gcc dot gnu.org
@ 2022-01-12 16:17 ` avieira at gcc dot gnu.org
  2022-01-13  7:13 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: avieira at gcc dot gnu.org @ 2022-01-12 16:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from avieira at gcc dot gnu.org ---
The patch Jeff mentioned is this:
[vect] PR103971, PR103977: Fix epilogue mode selection for autodetect only

gcc/ChangeLog:

* tree-vect-loop.c (vect-analyze-loop): Handle scenario where target
does not add autovectorize_vector_modes.

https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=016bd7523131b645bca5b5530c81ab5149922743

Should be OK to close this now?

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

* [Bug tree-optimization/103977] [12 Regression] ice in try_vectorize_loop_1 since r12-6420-gd3ff7420e941931d32ce2e332e7968fe67ba20af
  2022-01-11 12:10 [Bug c/103977] New: ice in try_vectorize_loop_1 dcb314 at hotmail dot com
                   ` (7 preceding siblings ...)
  2022-01-12 16:17 ` avieira at gcc dot gnu.org
@ 2022-01-13  7:13 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-13  7:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2022-01-13  7:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11 12:10 [Bug c/103977] New: ice in try_vectorize_loop_1 dcb314 at hotmail dot com
2022-01-11 12:17 ` [Bug tree-optimization/103977] " jakub at gcc dot gnu.org
2022-01-11 12:43 ` [Bug tree-optimization/103977] [12 Regression] ice in try_vectorize_loop_1 since r12-6420-gd3ff7420e941931d32ce2e332e7968fe67ba20af dcb314 at hotmail dot com
2022-01-11 12:59 ` rguenth at gcc dot gnu.org
2022-01-11 23:30 ` law at gcc dot gnu.org
2022-01-12 10:20 ` avieira at gcc dot gnu.org
2022-01-12 16:04 ` law at gcc dot gnu.org
2022-01-12 16:10 ` avieira at gcc dot gnu.org
2022-01-12 16:17 ` avieira at gcc dot gnu.org
2022-01-13  7:13 ` 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).