This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/65556] [5 Regression] ICE: verify_gimple failed (type precision mismatch in switch statement)


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
          Component|middle-end                  |c++
           Assignee|rguenth at gcc dot gnu.org         |unassigned at gcc dot gnu.org

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So we have

D.2334 = a.id;
D.2335 = (int) D.2334;
switch (D.2335) <default: <D.2336>, case 0: <D.2331>>

and

 <case_label_expr 0x7ffff68d80e0
    type <void_type 0x7ffff68f2000 void VOID
        align 8 symtab 0 alias set -1 canonical type 0x7ffff68f2000
        pointer_to_this <pointer_type 0x7ffff68f2150>>
    side-effects tree_1
    arg 0 <integer_cst 0x7ffff6a46d80 type <integer_type 0x7ffff68d07e0 long
int> constant 0>
    arg 2 <label_decl 0x7ffff6a4a100 D.2331 type <void_type 0x7ffff68f2000
void>
        ignored VOID file t.c line 9 col 1
        align 1 context <function_decl 0x7ffff6a4d000 main>>
    t.c:9:1>

which has a 'long int' value.  The original C++ code already looks bogus:

switch ((int) a.id)
  {
    case 0:;
  }

so there seems to be a disconnect in the C++ frontend for how the switch
variable and the cases promote.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]