public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/98177] New: [11 Regression] SVE: ICE in expand_direct_optab_fn, at internal-fn.c:3368
@ 2020-12-07 15:21 acoplan at gcc dot gnu.org
  2020-12-07 15:21 ` [Bug target/98177] " acoplan at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: acoplan at gcc dot gnu.org @ 2020-12-07 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98177
           Summary: [11 Regression] SVE: ICE in expand_direct_optab_fn, at
                    internal-fn.c:3368
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: acoplan at gcc dot gnu.org
  Target Milestone: ---

For the following C++ testcase:

int a, b;
short c;
void d(long e) {
  for (int f = 0; f < b; f += 1)
    for (short g = 0; g < c; g += 5)
      a = (short)e;
}

we ICE with -Ofast -march=armv8.2-a+sve -msve-vector-bits=128 since
r11-4912-g46c705e70e078f6a1920d92e49042125d5e18495.

To reproduce:

$ aarch64-elf-gcc -c -S -Ofast -march=armv8.2-a+sve -msve-vector-bits=128
test.cc
during RTL pass: expand
test.cc: In function 'void d(long int)':
test.cc:3:6: internal compiler error: in expand_direct_optab_fn, at
internal-fn.c:3368
    3 | void d(long e) {
      |      ^
0xd63e0f expand_direct_optab_fn
        /home/alecop01/toolchain/src/gcc/gcc/internal-fn.c:3368
0xd64978 expand_REDUC_MAX
        /home/alecop01/toolchain/src/gcc/gcc/internal-fn.def:209
0xd6631e expand_internal_call(internal_fn, gcall*)
        /home/alecop01/toolchain/src/gcc/gcc/internal-fn.c:4089
0xd66338 expand_internal_call(gcall*)
        /home/alecop01/toolchain/src/gcc/gcc/internal-fn.c:4097
0xae74ad expand_call_stmt
        /home/alecop01/toolchain/src/gcc/gcc/cfgexpand.c:2740
0xae74ad expand_gimple_stmt_1
        /home/alecop01/toolchain/src/gcc/gcc/cfgexpand.c:3835
0xae74ad expand_gimple_stmt
        /home/alecop01/toolchain/src/gcc/gcc/cfgexpand.c:3999
0xaf1827 expand_gimple_basic_block
        /home/alecop01/toolchain/src/gcc/gcc/cfgexpand.c:6043
0xaf2ede execute
        /home/alecop01/toolchain/src/gcc/gcc/cfgexpand.c:6727
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Curiously, I can only reproduce the ICE when the testcase is treated as C++. It
seems we fail to vectorize the testcase if we instead treat it as C.

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

* [Bug target/98177] [11 Regression] SVE: ICE in expand_direct_optab_fn, at internal-fn.c:3368
  2020-12-07 15:21 [Bug target/98177] New: [11 Regression] SVE: ICE in expand_direct_optab_fn, at internal-fn.c:3368 acoplan at gcc dot gnu.org
@ 2020-12-07 15:21 ` acoplan at gcc dot gnu.org
  2020-12-07 17:22 ` ktkachov at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: acoplan at gcc dot gnu.org @ 2020-12-07 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

Alex Coplan <acoplan at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsandifo at gcc dot gnu.org
             Target|                            |aarch64
   Target Milestone|---                         |11.0
      Known to fail|                            |11.0
           Keywords|                            |ice-on-valid-code

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

* [Bug target/98177] [11 Regression] SVE: ICE in expand_direct_optab_fn, at internal-fn.c:3368
  2020-12-07 15:21 [Bug target/98177] New: [11 Regression] SVE: ICE in expand_direct_optab_fn, at internal-fn.c:3368 acoplan at gcc dot gnu.org
  2020-12-07 15:21 ` [Bug target/98177] " acoplan at gcc dot gnu.org
@ 2020-12-07 17:22 ` ktkachov at gcc dot gnu.org
  2020-12-08  7:10 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2020-12-07 17:22 UTC (permalink / raw)
  To: gcc-bugs

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

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-12-07
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |ktkachov at gcc dot gnu.org

--- Comment #1 from ktkachov at gcc dot gnu.org ---
Confirmed.

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

* [Bug target/98177] [11 Regression] SVE: ICE in expand_direct_optab_fn, at internal-fn.c:3368
  2020-12-07 15:21 [Bug target/98177] New: [11 Regression] SVE: ICE in expand_direct_optab_fn, at internal-fn.c:3368 acoplan at gcc dot gnu.org
  2020-12-07 15:21 ` [Bug target/98177] " acoplan at gcc dot gnu.org
  2020-12-07 17:22 ` ktkachov at gcc dot gnu.org
@ 2020-12-08  7:10 ` rguenth at gcc dot gnu.org
  2020-12-18 18:21 ` cvs-commit at gcc dot gnu.org
  2021-01-04  9:53 ` wirkus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-12-08  7:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

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

* [Bug target/98177] [11 Regression] SVE: ICE in expand_direct_optab_fn, at internal-fn.c:3368
  2020-12-07 15:21 [Bug target/98177] New: [11 Regression] SVE: ICE in expand_direct_optab_fn, at internal-fn.c:3368 acoplan at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-12-08  7:10 ` rguenth at gcc dot gnu.org
@ 2020-12-18 18:21 ` cvs-commit at gcc dot gnu.org
  2021-01-04  9:53 ` wirkus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-18 18:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Przemyslaw Wirkus <wirkus@gcc.gnu.org>:

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

commit r11-6262-gd44d47b49267b4265cee16d25b3f89dbf967cc0c
Author: Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
Date:   Fri Dec 18 18:18:57 2020 +0000

    aarch64: SVE: ICE in expand_direct_optab_fn [PR98177]

    Problem comes from using the wrong interface to get the index type for a
    COND_REDUCTION. For fixed-length SVE we get a V2SI (a 64-bit Advanced
    SIMD vector) instead of a VNx2SI (an SVE vector that stores SI elements
    in DI containers).

    Credits to Richard Sandiford for pointing out the issue's root cause.

    Original PR snippet proposed to reproduce issue was only causing ICE for
C++
    compiler (see pr98177-1 test cases). I've slightly modified original
    snippet in order to reproduce issue on both C and C++ compilers. These
    are pr98177-2 test cases.

    gcc/ChangeLog:

            PR target/98177
            * tree-vect-loop.c (vect_create_epilog_for_reduction): Use
            get_same_sized_vectype to obtain index type.
            (vectorizable_reduction): Likewise.

    gcc/testsuite/ChangeLog:

            PR target/98177
            * g++.target/aarch64/sve/pr98177-1.C: New test.
            * g++.target/aarch64/sve/pr98177-2.C: New test.
            * gcc.target/aarch64/sve/pr98177-1.c: New test.
            * gcc.target/aarch64/sve/pr98177-2.c: New test.

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

* [Bug target/98177] [11 Regression] SVE: ICE in expand_direct_optab_fn, at internal-fn.c:3368
  2020-12-07 15:21 [Bug target/98177] New: [11 Regression] SVE: ICE in expand_direct_optab_fn, at internal-fn.c:3368 acoplan at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-12-18 18:21 ` cvs-commit at gcc dot gnu.org
@ 2021-01-04  9:53 ` wirkus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: wirkus at gcc dot gnu.org @ 2021-01-04  9:53 UTC (permalink / raw)
  To: gcc-bugs

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

Przemyslaw Wirkus <wirkus at gcc dot gnu.org> changed:

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

--- Comment #3 from Przemyslaw Wirkus <wirkus at gcc dot gnu.org> ---
I can confirm it's fixed. Confirmed with GCC built (aarch64-elf) with
0696141107d61483f38482b941549959a0d7f613 trunk (30 Dec '20).

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 15:21 [Bug target/98177] New: [11 Regression] SVE: ICE in expand_direct_optab_fn, at internal-fn.c:3368 acoplan at gcc dot gnu.org
2020-12-07 15:21 ` [Bug target/98177] " acoplan at gcc dot gnu.org
2020-12-07 17:22 ` ktkachov at gcc dot gnu.org
2020-12-08  7:10 ` rguenth at gcc dot gnu.org
2020-12-18 18:21 ` cvs-commit at gcc dot gnu.org
2021-01-04  9:53 ` wirkus 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).