public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/96915] New: ICE in tree-switch-conversion
@ 2020-09-03  9:51 ktkachov at gcc dot gnu.org
  2020-09-03 10:01 ` [Bug tree-optimization/96915] " ktkachov at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2020-09-03  9:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96915
           Summary: ICE in tree-switch-conversion
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ktkachov at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64*-*-*

The following SVE intrinsics code ICEs with -O3 -march=armv8.2-a+sve

#include <arm_sve.h>

void b (void);

void
a ()
{
  switch (svcntd())
  case 2:
  case 4:
    b();
}

during GIMPLE pass: switchconv
foo.c: In function 'a':
foo.c:12:1: internal compiler error: in expand, at tree-switch-conversion.c:988
   12 | }
      | ^
0xe475f1 tree_switch_conversion::switch_conversion::expand(gswitch*)
        $SRC/gcc/tree-switch-conversion.c:988
0xe478ae execute
        $SRC/gcc/tree-switch-conversion.c:2401
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.

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

* [Bug tree-optimization/96915] ICE in tree-switch-conversion
  2020-09-03  9:51 [Bug tree-optimization/96915] New: ICE in tree-switch-conversion ktkachov at gcc dot gnu.org
@ 2020-09-03 10:01 ` ktkachov at gcc dot gnu.org
  2020-09-03 10:59 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2020-09-03 10:01 UTC (permalink / raw)
  To: gcc-bugs

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

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |10.1.1

--- Comment #1 from ktkachov at gcc dot gnu.org ---
Reproduced on the GCC 10 branch as well. Since SVE ACLE intrinsics were only
added in GCC 10 it's technically not a regression

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

* [Bug tree-optimization/96915] ICE in tree-switch-conversion
  2020-09-03  9:51 [Bug tree-optimization/96915] New: ICE in tree-switch-conversion ktkachov at gcc dot gnu.org
  2020-09-03 10:01 ` [Bug tree-optimization/96915] " ktkachov at gcc dot gnu.org
@ 2020-09-03 10:59 ` rguenth at gcc dot gnu.org
  2020-09-03 11:17 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-09-03 10:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
  /* A switch on a constant should have been optimized in tree-cfg-cleanup.  */
  gcc_checking_assert (!TREE_CONSTANT (m_index_expr));

guess a POLY_INT_CST isn't really a constant so this check needs adjustment
(using TREE_CONSTANT is odd anyway).  The question is what goes wrong when
m_index_expr is constant?  I hope nothing.

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

* [Bug tree-optimization/96915] ICE in tree-switch-conversion
  2020-09-03  9:51 [Bug tree-optimization/96915] New: ICE in tree-switch-conversion ktkachov at gcc dot gnu.org
  2020-09-03 10:01 ` [Bug tree-optimization/96915] " ktkachov at gcc dot gnu.org
  2020-09-03 10:59 ` rguenth at gcc dot gnu.org
@ 2020-09-03 11:17 ` jakub at gcc dot gnu.org
  2020-09-21 10:53 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-09-03 11:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
tree-cfg.c only handles INTEGER_CST, so either we should check for just that in
the assertion, or better just drop it.  Dependence on some other pass
performing some optimization is IMHO bad, what if that pass hasn't run for some
reason, due to debug counters or whatever else.
If it doesn't want to handle INTEGER_CSTs, then it can always punt on them with
a reason that some other pass should handle those cases.

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

* [Bug tree-optimization/96915] ICE in tree-switch-conversion
  2020-09-03  9:51 [Bug tree-optimization/96915] New: ICE in tree-switch-conversion ktkachov at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-09-03 11:17 ` jakub at gcc dot gnu.org
@ 2020-09-21 10:53 ` marxin at gcc dot gnu.org
  2020-09-21 11:52 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-09-21 10:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2020-09-21
                URL|                            |https://gcc.gnu.org/piperma
                   |                            |il/gcc-patches/2020-Septemb
                   |                            |er/554371.html
     Ever confirmed|0                           |1

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
I've just sent patch to ML.

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

* [Bug tree-optimization/96915] ICE in tree-switch-conversion
  2020-09-03  9:51 [Bug tree-optimization/96915] New: ICE in tree-switch-conversion ktkachov at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-09-21 10:53 ` marxin at gcc dot gnu.org
@ 2020-09-21 11:52 ` cvs-commit at gcc dot gnu.org
  2020-09-21 11:54 ` marxin at gcc dot gnu.org
  2021-05-10 12:23 ` marxin at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-21 11:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Liska <marxin@gcc.gnu.org>:

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

commit r11-3320-gd726ecd9554a805d4a5e044cb21ca23a7f7ca49f
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Sep 21 12:50:37 2020 +0200

    Fix ICE in tree-switch-conversion.

    With SVE we can end up with:
    switch (POLY_INT_CST [2, 2]) <default: <L2> [INV], case 2: <L3> [INV], case
4: <L3> [INV]>
    which is fine to expand and we can remove the assert.

    gcc/ChangeLog:

            PR tree-optimization/96915
            * tree-switch-conversion.c (switch_conversion::expand): Accept
            also integer constants.

    gcc/testsuite/ChangeLog:

            PR tree-optimization/96915
            * gcc.target/aarch64/sve/pr96915.c: New test.

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

* [Bug tree-optimization/96915] ICE in tree-switch-conversion
  2020-09-03  9:51 [Bug tree-optimization/96915] New: ICE in tree-switch-conversion ktkachov at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-09-21 11:52 ` cvs-commit at gcc dot gnu.org
@ 2020-09-21 11:54 ` marxin at gcc dot gnu.org
  2021-05-10 12:23 ` marxin at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-09-21 11:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|11.0                        |
      Known to work|                            |11.0

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed on master.

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

* [Bug tree-optimization/96915] ICE in tree-switch-conversion
  2020-09-03  9:51 [Bug tree-optimization/96915] New: ICE in tree-switch-conversion ktkachov at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2020-09-21 11:54 ` marxin at gcc dot gnu.org
@ 2021-05-10 12:23 ` marxin at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-05-10 12:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2021-05-10 12:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03  9:51 [Bug tree-optimization/96915] New: ICE in tree-switch-conversion ktkachov at gcc dot gnu.org
2020-09-03 10:01 ` [Bug tree-optimization/96915] " ktkachov at gcc dot gnu.org
2020-09-03 10:59 ` rguenth at gcc dot gnu.org
2020-09-03 11:17 ` jakub at gcc dot gnu.org
2020-09-21 10:53 ` marxin at gcc dot gnu.org
2020-09-21 11:52 ` cvs-commit at gcc dot gnu.org
2020-09-21 11:54 ` marxin at gcc dot gnu.org
2021-05-10 12:23 ` marxin 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).