[Bug c/94731] New: [10 Regression] internal compiler error: in fold_convert_loc, at fold-const.c:2558

anbu1024.me at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Apr 23 13:58:41 GMT 2020


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

            Bug ID: 94731
           Summary: [10 Regression] internal compiler error: in
                    fold_convert_loc, at fold-const.c:2558
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat reduced.c 

int x = - 1 << 0 ; 

int foo () 
{ 
    switch ( x ) 
        case - 1 << 0 : 
            break ; 
}

int x[] = { 1 };

--------------------------------------------------------------------------------

$ gcc-10 --version
gcc (GCC) 10.0.1 20200419 (experimental)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

--------------------------------------------------------------------------------

$ gcc-10 reduced.c 
reduced.c:11:5: error: conflicting types for ‘x’
   11 | int x[] = { 1 };
      |     ^
reduced.c:2:5: note: previous definition of ‘x’ was here
    2 | int x = - 1 << 0 ;
      |     ^
during GIMPLE pass: cfg
reduced.c: In function ‘foo’:
reduced.c:4:5: internal compiler error: in fold_convert_loc, at
fold-const.c:2558
    4 | int foo ()
      |     ^~~
0x65b384 fold_convert_loc(unsigned int, tree_node*, tree_node*)
        ../../gcc-10-20200419/gcc/fold-const.c:2558
0xdf7852 convert_single_case_switch
        ../../gcc-10-20200419/gcc/tree-cfgcleanup.c:110
0xdf7852 cleanup_control_expr_graph
        ../../gcc-10-20200419/gcc/tree-cfgcleanup.c:145
0xdf7852 cleanup_control_flow_bb
        ../../gcc-10-20200419/gcc/tree-cfgcleanup.c:252
0xdf7a95 cleanup_control_flow_pre
        ../../gcc-10-20200419/gcc/tree-cfgcleanup.c:886
0xdf8c4b cleanup_tree_cfg_noloop
        ../../gcc-10-20200419/gcc/tree-cfgcleanup.c:1055
0xdf9428 cleanup_tree_cfg(unsigned int)
        ../../gcc-10-20200419/gcc/tree-cfgcleanup.c:1165
0xdf03a4 execute_build_cfg
        ../../gcc-10-20200419/gcc/tree-cfg.c:376
0xdf03a4 execute
        ../../gcc-10-20200419/gcc/tree-cfg.c:405
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.

--------------------------------------------------------------------------------

$ gcc-9 --version
gcc (GCC) 9.2.1 20191102
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

--------------------------------------------------------------------------------

$ gcc-9 reduced.c 
reduced.c:11:5: error: conflicting types for ‘x’
   11 | int x[] = { 1 };
      |     ^
reduced.c:2:5: note: previous definition of ‘x’ was here
    2 | int x = - 1 << 0 ;
      |     ^
reduced.c:4: confused by earlier errors, bailing out


More information about the Gcc-bugs mailing list