public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/98428] New: [11 regression] ICE with omp simd loop + optimization
@ 2020-12-23 17:17 evan@coeus-group.com
  2021-01-04  7:18 ` [Bug target/98428] [11 regression] ICE with omp simd loop + optimization since r11-2062-gc4facd483de2d5b6 marxin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: evan@coeus-group.com @ 2020-12-23 17:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98428
           Summary: [11 regression] ICE with omp simd loop + optimization
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: evan@coeus-group.com
  Target Milestone: ---

This is based on the gcc-11 currently in Debian experimental (gcc-11 (Debian
11-20201216-2) 11.0.0 20201216 (experimental) [master revision
4e42f6ebf48:da5e758223c:134afa38f0befc49f51747f3afe931fa4707c2f8]), but as
you'll see the build on Compiler Explorer also fails.

I'm getting an ICE when attempting to compile SIMDe on GCC 11 on x86_64 with
-O1.  Here is a minimized test case (or, on Compiler Explorer if you prefer:
<https://godbolt.org/z/Kb7MWf>):

    #include <emmintrin.h>
    typedef struct {
      float d[4];
    } f;
    typedef __m128 e;
    f k;
    float ak;
    e j;
    f fn1(e g) {
      __builtin_memcpy(&k, &g, sizeof(k));
      return k;
    }
    typedef struct {
      float d[8];
    } ag;
    void l() {
      ag ao;
      f ap = fn1(j);

    #pragma omp simd
      for (size_t i = 0; i < sizeof(ao.d[0]); i += 2)
        ao.d[i] = ao.d[i + 1] = ap.d[1];
      ag g = ao;
      __builtin_memcpy(&ak, &g, ak);
    }
    int main() {}

It generates an ICE with `-O1 -fopenmp-simd`. but removing either -O1 or
-fopenmp-simd makes compilation succeed.  This only happens on gcc-11; gcc-10
works as expected.

The original code which I fed into C-Reduce is at
<https://github.com/simd-everywhere/simde/blob/76790a981bedab5dc1c8e393f8dccf0ea0e3917d/test/x86/avx512/broadcast.c#L772-L820>,
and the `simde_mm512_maskz_broadcast_f64x2` function it calls is at
<https://github.com/simd-everywhere/simde/blob/76790a981bedab5dc1c8e393f8dccf0ea0e3917d/simde/x86/avx512/broadcast.h#L255-L267>

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

* [Bug target/98428] [11 regression] ICE with omp simd loop + optimization since r11-2062-gc4facd483de2d5b6
  2020-12-23 17:17 [Bug target/98428] New: [11 regression] ICE with omp simd loop + optimization evan@coeus-group.com
@ 2021-01-04  7:18 ` marxin at gcc dot gnu.org
  2021-01-05  9:43 ` [Bug tree-optimization/98428] " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-01-04  7:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
            Summary|[11 regression] ICE with    |[11 regression] ICE with
                   |omp simd loop +             |omp simd loop +
                   |optimization                |optimization since
                   |                            |r11-2062-gc4facd483de2d5b6
      Known to work|                            |10.2.0
   Last reconfirmed|                            |2021-01-04
      Known to fail|                            |11.0
             Status|UNCONFIRMED                 |NEW
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
   Target Milestone|---                         |11.0

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, started with r11-2062-gc4facd483de2d5b6.

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

* [Bug tree-optimization/98428] [11 regression] ICE with omp simd loop + optimization since r11-2062-gc4facd483de2d5b6
  2020-12-23 17:17 [Bug target/98428] New: [11 regression] ICE with omp simd loop + optimization evan@coeus-group.com
  2021-01-04  7:18 ` [Bug target/98428] [11 regression] ICE with omp simd loop + optimization since r11-2062-gc4facd483de2d5b6 marxin at gcc dot gnu.org
@ 2021-01-05  9:43 ` rguenth at gcc dot gnu.org
  2021-01-05 13:36 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-05  9:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
             Target|                            |x86_64-*-* i?86-*-*
          Component|target                      |tree-optimization
           Priority|P3                          |P1

--- Comment #2 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/98428] [11 regression] ICE with omp simd loop + optimization since r11-2062-gc4facd483de2d5b6
  2020-12-23 17:17 [Bug target/98428] New: [11 regression] ICE with omp simd loop + optimization evan@coeus-group.com
  2021-01-04  7:18 ` [Bug target/98428] [11 regression] ICE with omp simd loop + optimization since r11-2062-gc4facd483de2d5b6 marxin at gcc dot gnu.org
  2021-01-05  9:43 ` [Bug tree-optimization/98428] " rguenth at gcc dot gnu.org
@ 2021-01-05 13:36 ` rguenth at gcc dot gnu.org
  2021-01-05 15:43 ` cvs-commit at gcc dot gnu.org
  2021-01-05 16:04 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-05 13:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
The ICE is

during GIMPLE pass: vect
x.c: In function 'l':
x.c:16:6: internal compiler error: in as_a, at is-a.h:242
   16 | void l() {
      |      ^
0x18fb0a7 _bb_vec_info* as_a<_bb_vec_info*, vec_info>(vec_info*)
        /home/rguenther/src/gcc2/gcc/is-a.h:242
0x18f69de vect_schedule_slp_node
        /home/rguenther/src/gcc2/gcc/tree-vect-slp.c:6230
0x18f74a3 vect_schedule_scc
        /home/rguenther/src/gcc2/gcc/tree-vect-slp.c:6436
0x18f737a vect_schedule_scc
        /home/rguenther/src/gcc2/gcc/tree-vect-slp.c:6417
0x18f7b3e vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap, vl_ptr>)
        /home/rguenther/src/gcc2/gcc/tree-vect-slp.c:6552

with

(gdb) p debug (child)
x.c:16:6: note: node (external) 0x3afccc0 (max_nunits=1, refcnt=1)
x.c:16:6: note:         { }

being a pre-existing vector.  We pick this up unexpectedly for loop
vectorization since we failed to hoist the invariant lane extract

_22 = BIT_FIELD_REF <j.0_1, 32, 32>;

out of the loop.  It wasn't supposed to be supported for loop vect.

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

* [Bug tree-optimization/98428] [11 regression] ICE with omp simd loop + optimization since r11-2062-gc4facd483de2d5b6
  2020-12-23 17:17 [Bug target/98428] New: [11 regression] ICE with omp simd loop + optimization evan@coeus-group.com
                   ` (2 preceding siblings ...)
  2021-01-05 13:36 ` rguenth at gcc dot gnu.org
@ 2021-01-05 15:43 ` cvs-commit at gcc dot gnu.org
  2021-01-05 16:04 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-05 15:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:26b5062be991cf709c7c628061a40a48e1bca681

commit r11-6474-g26b5062be991cf709c7c628061a40a48e1bca681
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Jan 5 14:38:15 2021 +0100

    tree-optimization/98428 - avoid pre-existing vectors for loop SLP

    It wasn't supposed to be enabled and appearantly copying around the
    checking messed up the condition.

    2021-01-05  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/98428
            * tree-vect-slp.c (vect_build_slp_tree_1): Properly reject
            vector lane extracts for loop vectorization.

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

* [Bug tree-optimization/98428] [11 regression] ICE with omp simd loop + optimization since r11-2062-gc4facd483de2d5b6
  2020-12-23 17:17 [Bug target/98428] New: [11 regression] ICE with omp simd loop + optimization evan@coeus-group.com
                   ` (3 preceding siblings ...)
  2021-01-05 15:43 ` cvs-commit at gcc dot gnu.org
@ 2021-01-05 16:04 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-05 16:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2021-01-05 16:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-23 17:17 [Bug target/98428] New: [11 regression] ICE with omp simd loop + optimization evan@coeus-group.com
2021-01-04  7:18 ` [Bug target/98428] [11 regression] ICE with omp simd loop + optimization since r11-2062-gc4facd483de2d5b6 marxin at gcc dot gnu.org
2021-01-05  9:43 ` [Bug tree-optimization/98428] " rguenth at gcc dot gnu.org
2021-01-05 13:36 ` rguenth at gcc dot gnu.org
2021-01-05 15:43 ` cvs-commit at gcc dot gnu.org
2021-01-05 16:04 ` 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).