https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77988
Bug ID: 77988
Summary: ICE on valid 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: ---
It is a regression from 6.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/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 20161013 (experimental) [trunk revision 241143] (GCC)
$
$ gcc-trunk -O1 small.c
$ gcc-6.2 -Os small.c
$
$ gcc-trunk -Os small.c
small.c: In function ‘main’:
small.c:4:5: error: invalid address operand in MEM_REF
int main ()
^~~~
b[0];
small.c:4:5: error: invalid first operand of MEM_REF
&b[0]
small.c:15:11: note: in statement
if (*f)
^~
# VUSE <.MEM_9(D)>
_2 = b[0];
small.c:4:5: internal compiler error: verify_gimple failed
int main ()
^~~~
0xc31eff verify_gimple_in_cfg(function*, bool)
../../gcc-source-trunk/gcc/tree-cfg.c:5208
0xb12492 execute_function_todo
../../gcc-source-trunk/gcc/passes.c:1965
0xb12e49 execute_todo
../../gcc-source-trunk/gcc/passes.c:2015
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.
$
----------------------------------
static int a = 2;
int b[1], c, d;
int main ()
{
int e = a, *f = &b[0];
if (d)
for (e = 0; e < 1; e++)
;
if (e)
{
L1:
if (b < f)
__builtin_abort ();
if (*f)
c++;
return 0;
}
f = 0;
goto L1;
return 0;
}