public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/98084] New: [11 Regression] ICE in error: non-integral type switch statement
@ 2020-12-01 16:18 marxin at gcc dot gnu.org
  2020-12-01 16:18 ` [Bug tree-optimization/98084] " marxin at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-01 16:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98084
           Summary: [11 Regression] ICE in error: non-integral type switch
                    statement
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---

It's since if-to-switch revision, reduced from systemd:

$ cat ~/Programming/testcases/json.i
enum {
  JSON_VARIANT_STRING,
  JSON_VARIANT_UNSIGNED,
  JSON_VARIANT_REAL,
  JSON_VARIANT_ARRAY,
  _JSON_VARIANT_TYPE_INVALID,
  _JSON_VARIANT_MAGIC_ZERO_UNSIGNED,
  _JSON_VARIANT_MAGIC_ZERO_REAL,
  _JSON_VARIANT_MAGIC_EMPTY_STRING,
  _JSON_VARIANT_MAGIC_EMPTY_ARRAY
} json_variant_type(int *v) {
  if (!v)
    return _JSON_VARIANT_TYPE_INVALID;
  if (v == (int *)_JSON_VARIANT_MAGIC_ZERO_UNSIGNED)
    return JSON_VARIANT_UNSIGNED;
  if (v == (int *)_JSON_VARIANT_MAGIC_ZERO_REAL)
    return JSON_VARIANT_REAL;
  if (v == (int *)_JSON_VARIANT_MAGIC_EMPTY_STRING)
    return JSON_VARIANT_STRING;
  if (v == (int *)_JSON_VARIANT_MAGIC_EMPTY_ARRAY)
    return JSON_VARIANT_ARRAY;
}

$ ./xgcc -B. ~/Programming/testcases/json.i -c -O2
/home/marxin/Programming/testcases/json.i: In function ‘json_variant_type’:
/home/marxin/Programming/testcases/json.i:22:1: error: non-integral type switch
statement
   22 | }
      | ^
int *
switch (v_2(D)) <default: <L16> [INV], case 0B: <L11> [INV], case 5B: <L12>
[INV], case 6B: <L13> [INV], case 7B: <L14> [INV], case 8B: <L15> [INV]>
during GIMPLE pass: iftoswitch
/home/marxin/Programming/testcases/json.i:22:1: internal compiler error:
verify_gimple failed
0xe365da verify_gimple_in_cfg(function*, bool)
        /home/marxin/Programming/gcc/gcc/tree-cfg.c:5467
0xd1075f execute_function_todo
        /home/marxin/Programming/gcc/gcc/passes.c:2042
0xd115ac do_per_function
        /home/marxin/Programming/gcc/gcc/passes.c:1687
0xd115ac execute_todo
        /home/marxin/Programming/gcc/gcc/passes.c:2096
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] 5+ messages in thread

* [Bug tree-optimization/98084] [11 Regression] ICE in error: non-integral type switch statement
  2020-12-01 16:18 [Bug tree-optimization/98084] New: [11 Regression] ICE in error: non-integral type switch statement marxin at gcc dot gnu.org
@ 2020-12-01 16:18 ` marxin at gcc dot gnu.org
  2020-12-02  7:17 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-01 16:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-12-01
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |marxin at gcc dot gnu.org

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

* [Bug tree-optimization/98084] [11 Regression] ICE in error: non-integral type switch statement
  2020-12-01 16:18 [Bug tree-optimization/98084] New: [11 Regression] ICE in error: non-integral type switch statement marxin at gcc dot gnu.org
  2020-12-01 16:18 ` [Bug tree-optimization/98084] " marxin at gcc dot gnu.org
@ 2020-12-02  7:17 ` cvs-commit at gcc dot gnu.org
  2020-12-02  7:18 ` marxin at gcc dot gnu.org
  2020-12-02 12:09 ` cvs-commit at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-02  7:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 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:e4c02ce4ab6fce1148f4025360096f18764deadf

commit r11-5641-ge4c02ce4ab6fce1148f4025360096f18764deadf
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Dec 1 17:25:36 2020 +0100

    if-to-switch: consider only integral types

    gcc/ChangeLog:

            PR tree-optimization/98084
            * gimple-if-to-switch.cc (find_conditions): Consider only
            integral types.

    gcc/testsuite/ChangeLog:

            PR tree-optimization/98084
            * gcc.dg/tree-ssa/pr98084.c: New test.

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

* [Bug tree-optimization/98084] [11 Regression] ICE in error: non-integral type switch statement
  2020-12-01 16:18 [Bug tree-optimization/98084] New: [11 Regression] ICE in error: non-integral type switch statement marxin at gcc dot gnu.org
  2020-12-01 16:18 ` [Bug tree-optimization/98084] " marxin at gcc dot gnu.org
  2020-12-02  7:17 ` cvs-commit at gcc dot gnu.org
@ 2020-12-02  7:18 ` marxin at gcc dot gnu.org
  2020-12-02 12:09 ` cvs-commit at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-02  7:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

* [Bug tree-optimization/98084] [11 Regression] ICE in error: non-integral type switch statement
  2020-12-01 16:18 [Bug tree-optimization/98084] New: [11 Regression] ICE in error: non-integral type switch statement marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-12-02  7:18 ` marxin at gcc dot gnu.org
@ 2020-12-02 12:09 ` cvs-commit at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-02 12:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:d01ebe56c2f54bf4ac91ce389ecef734f557ea3e

commit r11-5651-gd01ebe56c2f54bf4ac91ce389ecef734f557ea3e
Author: Martin Liska <mliska@suse.cz>
Date:   Wed Dec 2 13:08:56 2020 +0100

    Add new test-case.

    gcc/testsuite/ChangeLog:

            PR tree-optimization/98084
            * gcc.dg/tree-ssa/pr98094.c: New test.

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

end of thread, other threads:[~2020-12-02 12:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01 16:18 [Bug tree-optimization/98084] New: [11 Regression] ICE in error: non-integral type switch statement marxin at gcc dot gnu.org
2020-12-01 16:18 ` [Bug tree-optimization/98084] " marxin at gcc dot gnu.org
2020-12-02  7:17 ` cvs-commit at gcc dot gnu.org
2020-12-02  7:18 ` marxin at gcc dot gnu.org
2020-12-02 12:09 ` cvs-commit 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).