[Bug tree-optimization/71916] New: gcc ICE at -O3 on valid code on x86_64-linux-gnu in "maybe_record_trace_start"

helloqirun at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Jul 18 13:15:00 GMT 2016


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

            Bug ID: 71916
           Summary: gcc ICE at -O3 on valid code on x86_64-linux-gnu in
                    "maybe_record_trace_start"
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at only -O3 on x86_64-linux-gnu in 64-bit mode. The 32-bit mode works fine.

It appears to be a 7 regression.

It might be related to PR71109, but that testcase cannot crash the current
trunk any more.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160717 (experimental) [trunk revision 238419] (GCC)


$ gcc-trunk -O3 abc.c
abc.c: In function ‘fn2’:
abc.c:35:1: internal compiler error: in maybe_record_trace_start, at
dwarf2cfi.c:2284
 }
 ^
0x7e0d80 maybe_record_trace_start
        ../../gcc/gcc/dwarf2cfi.c:2284
0x7e1085 create_trace_edges
        ../../gcc/gcc/dwarf2cfi.c:2376
0x7e31d1 scan_trace
        ../../gcc/gcc/dwarf2cfi.c:2590
0x7e3cca create_cfi_notes
        ../../gcc/gcc/dwarf2cfi.c:2616
0x7e3cca execute_dwarf2_frame
        ../../gcc/gcc/dwarf2cfi.c:2974
0x7e3cca execute
        ../../gcc/gcc/dwarf2cfi.c:3454
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.


$ cat abc.c
int a, b, c, d, f, g;
short h;
short (fn1) (short p1)
{
  return a >= 2 || p1 > 7 >> a ? p1 : p1 << a;
}

void fn2 ()
{
  for (;;)
    {
      int j[3];
      int i;
      h = b >= 2 ? d : d >> b;
      if (fn1 (f > h ^ c))
        {
          d = 0;
          for (; f <= 2;)
            {
              char k[2];
              for (;; i++)
                k[i] = 7;
            }
        }
      else
        for (;;)
          {
            int l = j[2];
            g = l;
          }
      if (g)
        for (;;)
          ;
    }
}


More information about the Gcc-bugs mailing list