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

            Bug ID: 67778
           Summary: ICE on valid code at -O3 on x86_64-linux-gnu in
                    maybe_record_trace_start, at dwarf2cfi.c:2297
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The following code causes an ICE when compiled with the current gcc trunk at
-O3 on x86_64-linux-gnu in 32-bit mode (but not in 64-bit mode). 

It is a regression from 5.2.x.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20150929 (experimental) [trunk revision 228242] (GCC) 
$ 
$ gcc-trunk -m32 -O2 small.c; ./a.out
$ gcc-trunk -m64 -O3 small.c; ./a.out
$ gcc-5.2 -m32 -O3 small.c; ./a.out
$ 
$ gcc-trunk -m32 -O3 small.c
small.c: In function ‘main’:
small.c:31:1: internal compiler error: in maybe_record_trace_start, at
dwarf2cfi.c:2297
 }
 ^
0x7790e1 maybe_record_trace_start
        ../../gcc-trunk/gcc/dwarf2cfi.c:2297
0x7793d3 create_trace_edges
        ../../gcc-trunk/gcc/dwarf2cfi.c:2389
0x77b50a scan_trace
        ../../gcc-trunk/gcc/dwarf2cfi.c:2603
0x77c23a create_cfi_notes
        ../../gcc-trunk/gcc/dwarf2cfi.c:2629
0x77c23a execute_dwarf2_frame
        ../../gcc-trunk/gcc/dwarf2cfi.c:2987
0x77c23a execute
        ../../gcc-trunk/gcc/dwarf2cfi.c:3467
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 


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


int a[1], b, c, d, e, f, i, j;

struct
{
  int f0;
} g, h;

int
main ()
{
  int *k = &e;
  for (; c; c++)
    ;
  for (e = 0; e < 1; e++)
    {
      if (f)
        {
          int l[1];
          i = l[0];
          *k = h.f0;
          for (; g.f0;)
            ;
        }
      f = 0;
    }
  for (; j; j++)
    b = a[b] ^ d; 
  b = a[b]; 

  return 0;
}

Reply via email to