public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/95713] New: [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 -m32
@ 2020-06-16 20:12 kretz at kde dot org
  2020-06-17  6:23 ` [Bug target/95713] [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 since r10-5031-g78307657cf9675bc marxin at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: kretz at kde dot org @ 2020-06-16 20:12 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95713
           Summary: [10/11 Regression] ICE in emit_move_insn when
                    converting int2 vector to short2 vector for
                    -march=skylake-avx512 -m32
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kretz at kde dot org
  Target Milestone: ---
            Target: i?86-*-*

Compile the following testcase with `-O1 -march=skylake-avx512 -m32` (cf.
https://godbolt.org/z/FASxSm):

using int2 [[gnu::vector_size(8)]] = int;
using short2 [[gnu::vector_size(4)]] = short;

void f(short2);
void g(int2 a)
{
  short2 b{short(a[0]), short(a[1])};
  f(4 > b);
}


Resulting Output:

during RTL pass: expand
<source>: In function 'void g(int2)':
<source>:7:38: internal compiler error: in emit_move_insn, at expr.c:3815
    7 |     short2 b{short(a[0]), short(a[1])};
      |                                      ^

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

* [Bug target/95713] [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 since r10-5031-g78307657cf9675bc
  2020-06-16 20:12 [Bug rtl-optimization/95713] New: [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 -m32 kretz at kde dot org
@ 2020-06-17  6:23 ` marxin at gcc dot gnu.org
  2020-06-17  6:54 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-06-17  6:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11 Regression] ICE in   |[10/11 Regression] ICE in
                   |emit_move_insn when         |emit_move_insn when
                   |converting int2 vector to   |converting int2 vector to
                   |short2 vector for           |short2 vector for
                   |-march=skylake-avx512 -m32  |-march=skylake-avx512 since
                   |                            |r10-5031-g78307657cf9675bc
             Status|UNCONFIRMED                 |NEW
      Known to fail|                            |10.1.0, 11.0
      Known to work|                            |9.3.0
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
   Last reconfirmed|                            |2020-06-17
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
-m32 is not necessary, started with r10-5031-g78307657cf9675bc

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

* [Bug target/95713] [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 since r10-5031-g78307657cf9675bc
  2020-06-16 20:12 [Bug rtl-optimization/95713] New: [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 -m32 kretz at kde dot org
  2020-06-17  6:23 ` [Bug target/95713] [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 since r10-5031-g78307657cf9675bc marxin at gcc dot gnu.org
@ 2020-06-17  6:54 ` rguenth at gcc dot gnu.org
  2020-06-17  6:59 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-06-17  6:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|i?86-*-*                    |x86_64-*-* i?86-*-*
   Target Milestone|---                         |10.2
                 CC|                            |hjl.tools at gmail dot com,
                   |                            |kyukhin at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the expansion of

  b_4 = VEC_PACK_TRUNC_EXPR <_2, _7>;

with two V1SI operands results in a DImode rtx (reg:DI 93) but RTL
expansion wants to see it in (reg:SI 84) (that is b).  But the
simplistic code doing that doesn't work (obviously):

                temp = force_operand (temp, target);
                if (temp != target)
                  emit_move_insn (target, temp);

I guess the expansion of VEC_PACK_TRUNC_EXPR is "wrong".  We do have
CODE_FOR_vec_pack_trunc_si but that maps to

(define_expand "vec_pack_trunc_<mode>"
  [(set (match_operand:<DOUBLEMASKMODE> 0 "register_operand")
        (ior:<DOUBLEMASKMODE>
          (ashift:<DOUBLEMASKMODE>
            (zero_extend:<DOUBLEMASKMODE>
              (match_operand:SWI24 2 "register_operand"))
            (match_dup 3))
          (zero_extend:<DOUBLEMASKMODE>
            (match_operand:SWI24 1 "register_operand"))))]
  "TARGET_AVX512BW"

where expand_binop_directly does

1098      if (binoptab == vec_pack_trunc_optab
...
1106          /* The mode of the result is different then the mode of the
1107             arguments.  */
1108          tmp_mode = insn_data[(int) icode].operand[0].mode;

and tmp_mode ends up as DImode.  Shouldn't the pattern use HALFMASKMODE?

Are those patterns supposed to only trigger for VECTOR_BOOLEAN and not
"generic" vectors mapping to integer modes?

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

* [Bug target/95713] [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 since r10-5031-g78307657cf9675bc
  2020-06-16 20:12 [Bug rtl-optimization/95713] New: [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 -m32 kretz at kde dot org
  2020-06-17  6:23 ` [Bug target/95713] [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 since r10-5031-g78307657cf9675bc marxin at gcc dot gnu.org
  2020-06-17  6:54 ` rguenth at gcc dot gnu.org
@ 2020-06-17  6:59 ` rguenth at gcc dot gnu.org
  2020-06-17  8:46 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-06-17  6:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Looks really similar to PR95528.

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

* [Bug target/95713] [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 since r10-5031-g78307657cf9675bc
  2020-06-16 20:12 [Bug rtl-optimization/95713] New: [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 -m32 kretz at kde dot org
                   ` (2 preceding siblings ...)
  2020-06-17  6:59 ` rguenth at gcc dot gnu.org
@ 2020-06-17  8:46 ` jakub at gcc dot gnu.org
  2020-06-17  9:53 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-06-17  8:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Ah, that is the exception Richard wanted for aarch64 :(.

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

* [Bug target/95713] [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 since r10-5031-g78307657cf9675bc
  2020-06-16 20:12 [Bug rtl-optimization/95713] New: [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 -m32 kretz at kde dot org
                   ` (3 preceding siblings ...)
  2020-06-17  8:46 ` jakub at gcc dot gnu.org
@ 2020-06-17  9:53 ` jakub at gcc dot gnu.org
  2020-06-18  8:25 ` kretz at kde dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-06-17  9:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 48748
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48748&action=edit
gcc11-pr95713.patch

Untested fix.

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

* [Bug target/95713] [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 since r10-5031-g78307657cf9675bc
  2020-06-16 20:12 [Bug rtl-optimization/95713] New: [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 -m32 kretz at kde dot org
                   ` (4 preceding siblings ...)
  2020-06-17  9:53 ` jakub at gcc dot gnu.org
@ 2020-06-18  8:25 ` kretz at kde dot org
  2020-06-18 10:13 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: kretz at kde dot org @ 2020-06-18  8:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Matthias Kretz (Vir) <kretz at kde dot org> ---
Thank you! I applied the patch (with the necessary context) to the GCC 10
branch and was able to verify that it also fixes my unreduced test cases.

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

* [Bug target/95713] [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 since r10-5031-g78307657cf9675bc
  2020-06-16 20:12 [Bug rtl-optimization/95713] New: [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 -m32 kretz at kde dot org
                   ` (5 preceding siblings ...)
  2020-06-18  8:25 ` kretz at kde dot org
@ 2020-06-18 10:13 ` cvs-commit at gcc dot gnu.org
  2020-06-18 10:18 ` cvs-commit at gcc dot gnu.org
  2020-06-29  9:56 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-18 10:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:9a875db43cd4210843c480c8df26a1d6624d057d

commit r11-1503-g9a875db43cd4210843c480c8df26a1d6624d057d
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Jun 18 12:08:06 2020 +0200

    forwprop: simplify_vector_constructor follow-up fix [PR95713]

    As the following testcase shows, the exception for the aarch64
    vec_pack_trunc_di is not sufficient on x86, the halfvectype
    "vectors" have SImode but the x86 vec_pack_trunc_si meant for
    the bool bitmasks combines 2x SImode into DImode, while in the
    testcase the halfvectype is 1x SImode "vector" with SImode and
    result is 2x HImode "vector" with SImode.

    Richard Sandiford's reply:
    FWIW, since the aarch64 case was only found by inspection and might
    not be useful, personally I'd prefer to drop that case after all.

    2020-06-18  Jakub Jelinek  <jakub@redhat.com>

            PR target/95713
            * tree-ssa-forwprop.c (simplify_vector_constructor): Don't allow
            scalar mode halfvectype other than vector boolean for
            VEC_PACK_TRUNC_EXPR.

            * gcc.dg/pr95713.c: New test.

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

* [Bug target/95713] [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 since r10-5031-g78307657cf9675bc
  2020-06-16 20:12 [Bug rtl-optimization/95713] New: [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 -m32 kretz at kde dot org
                   ` (6 preceding siblings ...)
  2020-06-18 10:13 ` cvs-commit at gcc dot gnu.org
@ 2020-06-18 10:18 ` cvs-commit at gcc dot gnu.org
  2020-06-29  9:56 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-18 10:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:0c7d18d51a8e9abd085afd0b01743662fd0419fa

commit r10-8323-g0c7d18d51a8e9abd085afd0b01743662fd0419fa
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Jun 18 12:08:06 2020 +0200

    forwprop: simplify_vector_constructor follow-up fix [PR95713]

    As the following testcase shows, the exception for the aarch64
    vec_pack_trunc_di is not sufficient on x86, the halfvectype
    "vectors" have SImode but the x86 vec_pack_trunc_si meant for
    the bool bitmasks combines 2x SImode into DImode, while in the
    testcase the halfvectype is 1x SImode "vector" with SImode and
    result is 2x HImode "vector" with SImode.

    Richard Sandiford's reply:
    FWIW, since the aarch64 case was only found by inspection and might
    not be useful, personally I'd prefer to drop that case after all.

    2020-06-18  Jakub Jelinek  <jakub@redhat.com>

            PR target/95713
            * tree-ssa-forwprop.c (simplify_vector_constructor): Don't allow
            scalar mode halfvectype other than vector boolean for
            VEC_PACK_TRUNC_EXPR.

            * gcc.dg/pr95713.c: New test.

    (cherry picked from commit 9a875db43cd4210843c480c8df26a1d6624d057d)

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

* [Bug target/95713] [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 since r10-5031-g78307657cf9675bc
  2020-06-16 20:12 [Bug rtl-optimization/95713] New: [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 -m32 kretz at kde dot org
                   ` (7 preceding siblings ...)
  2020-06-18 10:18 ` cvs-commit at gcc dot gnu.org
@ 2020-06-29  9:56 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-06-29  9:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed now.

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

end of thread, other threads:[~2020-06-29  9:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 20:12 [Bug rtl-optimization/95713] New: [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 -m32 kretz at kde dot org
2020-06-17  6:23 ` [Bug target/95713] [10/11 Regression] ICE in emit_move_insn when converting int2 vector to short2 vector for -march=skylake-avx512 since r10-5031-g78307657cf9675bc marxin at gcc dot gnu.org
2020-06-17  6:54 ` rguenth at gcc dot gnu.org
2020-06-17  6:59 ` rguenth at gcc dot gnu.org
2020-06-17  8:46 ` jakub at gcc dot gnu.org
2020-06-17  9:53 ` jakub at gcc dot gnu.org
2020-06-18  8:25 ` kretz at kde dot org
2020-06-18 10:13 ` cvs-commit at gcc dot gnu.org
2020-06-18 10:18 ` cvs-commit at gcc dot gnu.org
2020-06-29  9:56 ` jakub 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).