public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/104662] New: arm: ice in simd_valid_immediate
@ 2022-02-23 13:38 dcb314 at hotmail dot com
  2022-02-24 14:34 ` [Bug target/104662] " clyon at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dcb314 at hotmail dot com @ 2022-02-23 13:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

For testsuite file ./gcc.dg/rtl/arm/mve-vxbi.c, compiled
with a recent arm cross compiler, hosted on x86, does this:

$ /home/dcb/raspberrypi/results/bin/arm-linux-gnueabihf-gcc -c
./gcc.dg/rtl/arm/mve-vxbi.c
during RTL pass: ira
./gcc.dg/rtl/arm/mve-vxbi.c: In function ‘foo’:
./gcc.dg/rtl/arm/mve-vxbi.c:27:1: internal compiler error: in
simd_valid_immedia
te, at config/arm/arm.cc:12866
   27 | }
      | ^
0x7a67f1 simd_valid_immediate
        /home/dcb/gcc/trunk.git/gcc/config/arm/arm.cc:12866
0x1375f59 simd_immediate_valid_for_move(rtx_def*, machine_mode, rtx_def**,
int*)
        /home/dcb/gcc/trunk.git/gcc/config/arm/arm.cc:12974

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

* [Bug target/104662] arm: ice in simd_valid_immediate
  2022-02-23 13:38 [Bug target/104662] New: arm: ice in simd_valid_immediate dcb314 at hotmail dot com
@ 2022-02-24 14:34 ` clyon at gcc dot gnu.org
  2022-02-24 14:38 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: clyon at gcc dot gnu.org @ 2022-02-24 14:34 UTC (permalink / raw)
  To: gcc-bugs

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

Christophe Lyon <clyon at gcc dot gnu.org> changed:

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

--- Comment #1 from Christophe Lyon <clyon at gcc dot gnu.org> ---
Hello,
Do you mean you are running 'make check' with a cross-gcc configure with
--target arm-linux-gnueabif and you see this failure? On my side, 'make check'
shows no error on this test.

Given the flags you show, it seems you are in fact compiling the testcase by
hand, effectively not including the mandatory -march=armv8.1-m.main+mve?
V*BI types require MVE, so the test is not supposed to run without this option.

However, this small change avoids the ICE:

diff --git a/gcc/config/arm/arm.cc b/gcc/config/arm/arm.cc
index c1103d9..5adc45b 100644
--- a/gcc/config/arm/arm.cc
+++ b/gcc/config/arm/arm.cc
@@ -12811,6 +12811,9 @@ simd_valid_immediate (rtx op, machine_mode mode, int
inverse,
          || n_elts * innersize != 16))
     return -1;

+  if (!TARGET_HAVE_MVE && (GET_MODE_CLASS (mode) == MODE_VECTOR_BOOL))
+         return -1;
+
   /* Vectors of float constants.  */
   if (GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
     {

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

* [Bug target/104662] arm: ice in simd_valid_immediate
  2022-02-23 13:38 [Bug target/104662] New: arm: ice in simd_valid_immediate dcb314 at hotmail dot com
  2022-02-24 14:34 ` [Bug target/104662] " clyon at gcc dot gnu.org
@ 2022-02-24 14:38 ` jakub at gcc dot gnu.org
  2022-04-25  9:24 ` clyon at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-24 14:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Christophe Lyon from comment #1)
> --- a/gcc/config/arm/arm.cc
> +++ b/gcc/config/arm/arm.cc
> @@ -12811,6 +12811,9 @@ simd_valid_immediate (rtx op, machine_mode mode, int
> inverse,
>           || n_elts * innersize != 16))
>      return -1;
>  
> +  if (!TARGET_HAVE_MVE && (GET_MODE_CLASS (mode) == MODE_VECTOR_BOOL))
> +         return -1;
> +
>    /* Vectors of float constants.  */
>    if (GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
>      {

Formatting, wrong indentation of return -1; and useless ()s around the ==.

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

* [Bug target/104662] arm: ice in simd_valid_immediate
  2022-02-23 13:38 [Bug target/104662] New: arm: ice in simd_valid_immediate dcb314 at hotmail dot com
  2022-02-24 14:34 ` [Bug target/104662] " clyon at gcc dot gnu.org
  2022-02-24 14:38 ` jakub at gcc dot gnu.org
@ 2022-04-25  9:24 ` clyon at gcc dot gnu.org
  2022-05-04  8:19 ` cvs-commit at gcc dot gnu.org
  2022-05-04  8:23 ` clyon at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: clyon at gcc dot gnu.org @ 2022-04-25  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

Christophe Lyon <clyon at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-04-25
           Assignee|unassigned at gcc dot gnu.org      |clyon at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

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

* [Bug target/104662] arm: ice in simd_valid_immediate
  2022-02-23 13:38 [Bug target/104662] New: arm: ice in simd_valid_immediate dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2022-04-25  9:24 ` clyon at gcc dot gnu.org
@ 2022-05-04  8:19 ` cvs-commit at gcc dot gnu.org
  2022-05-04  8:23 ` clyon at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-04  8:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Christophe Lyon <clyon@gcc.gnu.org>:

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

commit r13-102-ge2285af309000b74da0f7dc756a0b55e5f0b1b56
Author: Christophe Lyon <christophe.lyon@arm.com>
Date:   Tue Apr 19 17:34:04 2022 +0200

    arm: Restrict support of vectors of boolean immediates (PR target/104662)

    This simple patch avoids the ICE described in the PR:
    internal compiler error: in simd_valid_immediate, at
config/arm/arm.cc:12866

    with an early exit from simd_valid_immediate if we are trying to
    handle a vector of booleans and MVE is not enabled.

    We still get an ICE when compiling the existing
    gcc.dg/rtl/arm/mve-vxbi.c without -march=armv8.1-m.main+mve:

    error: unrecognizable insn:
    (insn 7 5 8 2 (set (reg:V4BI 114)
            (const_vector:V4BI [
                    (const_int 1 [0x1])
                    (const_int 0 [0]) repeated x2
                    (const_int 1 [0x1])
                ])) -1
         (nil))
    during RTL pass: ira

    but there's little we can do since the testcase explicitly creates
    vectors of booleans which do need MVE.

    That is the reason why I do not add a testcase.

    2022-04-19  Christophe Lyon  <christophe.lyon@arm.com>

            PR target/104662
            * config/arm/arm.cc (simd_valid_immediate): Exit when input is a
            vector of booleans and MVE is not enabled.

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

* [Bug target/104662] arm: ice in simd_valid_immediate
  2022-02-23 13:38 [Bug target/104662] New: arm: ice in simd_valid_immediate dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2022-05-04  8:19 ` cvs-commit at gcc dot gnu.org
@ 2022-05-04  8:23 ` clyon at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: clyon at gcc dot gnu.org @ 2022-05-04  8:23 UTC (permalink / raw)
  To: gcc-bugs

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

Christophe Lyon <clyon at gcc dot gnu.org> changed:

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

--- Comment #4 from Christophe Lyon <clyon at gcc dot gnu.org> ---
Fixed on trunk.

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

end of thread, other threads:[~2022-05-04  8:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-23 13:38 [Bug target/104662] New: arm: ice in simd_valid_immediate dcb314 at hotmail dot com
2022-02-24 14:34 ` [Bug target/104662] " clyon at gcc dot gnu.org
2022-02-24 14:38 ` jakub at gcc dot gnu.org
2022-04-25  9:24 ` clyon at gcc dot gnu.org
2022-05-04  8:19 ` cvs-commit at gcc dot gnu.org
2022-05-04  8:23 ` clyon 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).