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 tree-optimization/69666] New: gcc ICE at -O2 and -O3 on valid code on x86_64-linux-gnu in "verify_gimple failed"


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

            Bug ID: 69666
           Summary: gcc ICE at -O2 and -O3 on valid code on
                    x86_64-linux-gnu in "verify_gimple failed"
           Product: gcc
           Version: 6.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 -O2 and -O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes.


$ 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/6.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 6.0.0 20160203 (experimental) [trunk revision 233104] (GCC)



$ gcc-trunk abc.c -O2
abc.c: In function 'fun2':
abc.c:13:1: error: conversion of register to a different size
 }
 ^
VIEW_CONVERT_EXPR<unsigned char>(e_10(D));

_4 = VIEW_CONVERT_EXPR<unsigned char>(e_10(D));
abc.c:13:1: internal compiler error: verify_gimple failed
0xba0056 verify_gimple_in_cfg(function*, bool)
        ../../gcc/gcc/tree-cfg.c:5125
0xa935d7 execute_function_todo
        ../../gcc/gcc/passes.c:1958
0xa93ecb execute_todo
        ../../gcc/gcc/passes.c:2010
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, c, d;
float b;
void *memcpy();
int fun1(int p1, unsigned char *p2) {
  p2[p1] = b;
  return a;
}
void fun2() {
  unsigned char e[16];
  fun1(16, e);
  d = e[d];
  memcpy(&c, e, sizeof(e));
}

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