https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71405
Bug ID: 71405
Summary: ICE on valid C++ code at -Os and above on
x86_64-linux-gnu: verify_gimple failed
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-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
-Os and above on x86_64-linux-gnu in both 32-bit and 64-bit modes.
This is a regression from 6.1.x.
$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160603 (experimental) [trunk revision 237059] (GCC)
$
$ g++-trunk -O1 small.cpp
$ g++-6.1 -Os small.cpp
$
$ g++-trunk -Os small.cpp
small.cpp: In function ‘int main()’:
small.cpp:17:1: error: invalid reference prefix
}
^
{CLOBBER}
small.cpp:3:8: note: in statement
C () {}
^
a_5 ={v} VIEW_CONVERT_EXPR<int>({CLOBBER});
small.cpp:17:1: internal compiler error: verify_gimple failed
}
^
0xdf07ff verify_gimple_in_cfg(function*, bool)
../../gcc-source-trunk/gcc/tree-cfg.c:5211
0xcde2a2 execute_function_todo
../../gcc-source-trunk/gcc/passes.c:1964
0xcdec9b execute_todo
../../gcc-source-trunk/gcc/passes.c:2016
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.
$
-------------------------------------------------
struct C
{
C () {}
int i;
};
void *operator new (unsigned long p1, void *p2)
{
return p2;
}
int main ()
{
int a;
new (&a) C;
return 0;
}