GCC 4.9.2 compile bug

LAMMPS developers,

When I attempt to compile lammps-15May15 on a CRAY XC40, I get an internal
compiler error when compiling using gcc 4.9.2 with -O2 as one of the flags.
Switching to -O0 or gcc/4.8.1 makes the error go away. The intel compiler
does not produce an error using its -O2 optimization level. I have
successfully compiled lammps with -O2 and gnu (but not gnu 4.9.2) on various
other systems before.

The error output is as follows:

CC -O2 -Wall -g -Wextra -frounding-math -fsignaling-nans -march=native
-ftrapv -fexceptions -DLAMMPS_GZIP -DLAMMPS_JPEG -DMPICH_SKIP_MPICXX
-DOMPI_SKIP_MPICXX=1 -DFFT_FFTW3 -c ../pair_hybrid.cpp
In member function 'void LAMMPS_NS::PairHybrid::allocate()':
cc1plus: internal compiler error: in gimplify_modify_expr, at
gimplify.c:4616
0x86fb8a gimplify_modify_expr
    ../../cray-gcc-4.9.2/gcc/gimplify.c:4616
0x8719d7 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../../cray-gcc-4.9.2/gcc/gimplify.c:7627
0x8733f6 gimplify_stmt(tree_node**, gimple_statement_base**)
    ../../cray-gcc-4.9.2/gcc/gimplify.c:5373
0x8759b7 gimplify_cond_expr
    ../../cray-gcc-4.9.2/gcc/gimplify.c:3086
0x871412 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../../cray-gcc-4.9.2/gcc/gimplify.c:7583
0x8733f6 gimplify_stmt(tree_node**, gimple_statement_base**)
    ../../cray-gcc-4.9.2/gcc/gimplify.c:5373
0x875757 gimplify_cond_expr
    ../../cray-gcc-4.9.2/gcc/gimplify.c:2981
0x871412 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../../cray-gcc-4.9.2/gcc/gimplify.c:7583
0x871d25 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../../cray-gcc-4.9.2/gcc/gimplify.c:8314
0x8706e7 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../../cray-gcc-4.9.2/gcc/gimplify.c:7567
0x879a31 force_gimple_operand_1(tree_node*, gimple_statement_base**, bool
(*)(tree_node*), tree_node*)
    ../../cray-gcc-4.9.2/gcc/gimplify-me.c:84
0xab3ea5 create_iv(tree_node*, tree_node*, tree_node*, loop*,
gimple_stmt_iterator*, bool, tree_node**, tree_node**)
    ../../cray-gcc-4.9.2/gcc/tree-ssa-loop-manip.c:132
0xab2f12 create_new_iv
    ../../cray-gcc-4.9.2/gcc/tree-ssa-loop-ivopts.c:6195
0xab2f12 create_new_ivs
    ../../cray-gcc-4.9.2/gcc/tree-ssa-loop-ivopts.c:6210
0xab2f12 tree_ssa_iv_optimize_loop
    ../../cray-gcc-4.9.2/gcc/tree-ssa-loop-ivopts.c:6866
0xab2f12 tree_ssa_iv_optimize()
    ../../cray-gcc-4.9.2/gcc/tree-ssa-loop-ivopts.c:6902
0xabfa07 tree_ssa_loop_ivopts
    ../../cray-gcc-4.9.2/gcc/tree-ssa-loop.c:362
0xabfa07 execute
    ../../cray-gcc-4.9.2/gcc/tree-ssa-loop.c:398
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.
make[1]: *** [pair_hybrid.o] Error 1
make[1]: Leaving directory
`/p/home/forhelpdesk/lammps-15May15/src/Obj_gnuxc40'
make: *** [gnuxc40] Error 2

Is this a known bug or something new?

George Petit
Lockheed Martin
ARL DSRC Customer Support Team Lead
[email protected]...
410-278-9283

if I’m not mistaken, this looks like a compiler error

if I’m not mistaken, this looks like a compiler error

Yes, an internal compiler error is always a compiler bug. One may sometimes be able to work around it by turning off certain optimizations. In this case I would try to turn off the vectorizer. gcc is bad at it anyway.

Axel.