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

            Bug ID: 101562
           Summary: [9/10/11/12 Regression] ICE in insert, at
                    wide-int.cc:682
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r7, at -O2+ :

(gcc here configured with --enable-checking=yes)
(helpful warning with -O2 -Wall, but not with -O1 -Wall)
(-> array subscript is above array bounds)


$ cat z1.c
struct S { char c; };
void g (struct S a, struct S b);
void f ()
{
  struct S x[1];
  x[0].c = 0;
  x[1].c = 1;
  g (x[0], x[1]);
  return;
}


$ gcc-6 -c z1.c -O2
$ gcc-12-20210718 -c z1.c -O1
$
$ gcc-12-20210718 -c z1.c -O2
during RTL pass: combine
z1.c: In function 'f':
z1.c:10:1: internal compiler error: in insert, at wide-int.cc:682
   10 | }
      | ^
0x11ad9c1 wi::insert(generic_wide_int<wide_int_storage> const&,
generic_wide_int<wide_int_storage> const&, unsigned int, unsigned int)
        ../../gcc/wide-int.cc:682
0x17f6c2e try_combine
        ../../gcc/combine.c:2839
0x17f9860 combine_instructions
        ../../gcc/combine.c:1269
0x17f9860 rest_of_handle_combine
        ../../gcc/combine.c:14873
0x17f9860 execute
        ../../gcc/combine.c:14918

Reply via email to