This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/69740] [5/6 Regression] gcc ICE at -O2 and above on valid code on x86_64-linux-gnu in "verify_loop_structure"
- From: "helloqirun at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 21 Feb 2016 23:33:09 +0000
- Subject: [Bug tree-optimization/69740] [5/6 Regression] gcc ICE at -O2 and above on valid code on x86_64-linux-gnu in "verify_loop_structure"
- Auto-submitted: auto-generated
- References: <bug-69740-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69740
--- Comment #3 from Qirun Zhang <helloqirun at gmail dot com> ---
(In reply to Jakub Jelinek from comment #1)
> Started with r218566.
Here is a similar case. The stack trace is almost the same as in the original
RP's. However, this one crashes the current trunk at -O3 only (The original RP
still crashes the current trunk at -O2 and above).
I am not sure if this is a dup of the original RP..
$ 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 20160221 (experimental) [trunk revision 233594] (GCC)
$ gcc-trunk -O2 abc.c
$ gcc-trunk -Os abc.c
$ gcc-trunk -O3 abc.c
abc.c: In function 'main':
abc.c:7:5: error: loop with header 5 not in loop tree
int main() {
^~~~
abc.c:7:5: internal compiler error: in verify_loop_structure, at cfgloop.c:1639
0x75e6bf verify_loop_structure()
../../gcc/gcc/cfgloop.c:1639
0x9d9e9e checking_verify_loop_structure
../../gcc/gcc/cfgloop.h:324
0x9d9e9e loop_optimizer_init(unsigned int)
../../gcc/gcc/loop-init.c:106
0xd198dd execute
../../gcc/gcc/tree-ssa-sink.c:619
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
inline int foo(int *p1, int p2) {
int z = *p1;
while (z > p2)
p2 = 2;
return z;
}
int main() {
int i;
for (;;) {
int j, k;
i = foo(&k, 7);
if (k)
j = i;
else
k = j;
if (2 != j)
__builtin_abort();
}
}