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

            Bug ID: 89858
           Summary: crash with libmpfr.so.6
           Product: gcc
           Version: 8.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hans.buchmann at fhnw dot ch
  Target Milestone: ---

Compiling the code:

------------------------------------------
static const unsigned LEN=2;
unsigned data[LEN];
void start()
{
 for(unsigned i=0;i<LEN;++i) data[i]=0;
}
------------------------------------------

with:

../tc/bin/nios2-linux-gnu-g++ -O2 -c -o bug.o bug.cc

results in the following error:

------------------------------------------
during GIMPLE pass: evrp
bug.cc: In function 'void start()':
bug.cc:6:1: internal compiler error: Illegal instruction
 }
 ^
0xab35ff crash_signal
        /home/buchmann/resources/gcc-8.3.0/gcc/toplev.c:325
0xd58f31 wi::from_mpz(tree_node const*, __mpz_struct*, bool)
        /home/buchmann/resources/gcc-8.3.0/gcc/wide-int.cc:269
0xbde2fe number_of_iterations_lt
        /home/buchmann/resources/gcc-8.3.0/gcc/tree-ssa-loop-niter.c:1502
0xbe187a number_of_iterations_le
        /home/buchmann/resources/gcc-8.3.0/gcc/tree-ssa-loop-niter.c:1618
0xbe187a number_of_iterations_cond
        /home/buchmann/resources/gcc-8.3.0/gcc/tree-ssa-loop-niter.c:1821
0xbe187a number_of_iterations_exit_assumptions(loop*, edge_def*,
tree_niter_desc*, gcond**, bool)
        /home/buchmann/resources/gcc-8.3.0/gcc/tree-ssa-loop-niter.c:2375
0xbe2081 number_of_iterations_exit_assumptions(loop*, edge_def*,
tree_niter_desc*, gcond**, bool)
        /home/buchmann/resources/gcc-8.3.0/gcc/tree-ssa-loop-niter.c:2455
0xbe2081 number_of_iterations_exit(loop*, edge_def*, tree_niter_desc*, bool,
bool)
        /home/buchmann/resources/gcc-8.3.0/gcc/tree-ssa-loop-niter.c:2442
0xb6b80d number_of_latch_executions(loop*)
        /home/buchmann/resources/gcc-8.3.0/gcc/tree-scalar-evolution.c:2904
0xbe32df estimate_numbers_of_iterations(loop*)
        /home/buchmann/resources/gcc-8.3.0/gcc/tree-ssa-loop-niter.c:3920
0xbe5fcf loop_exits_before_overflow
        /home/buchmann/resources/gcc-8.3.0/gcc/tree-ssa-loop-niter.c:4328
0xbe5fcf scev_probably_wraps_p(tree_node*, tree_node*, tree_node*, gimple*,
loop*, bool)
        /home/buchmann/resources/gcc-8.3.0/gcc/tree-ssa-loop-niter.c:4580
0xbe5fcf scev_probably_wraps_p(tree_node*, tree_node*, tree_node*, gimple*,
loop*, bool)
        /home/buchmann/resources/gcc-8.3.0/gcc/tree-ssa-loop-niter.c:4538
0xd510c1 vr_values::adjust_range_with_scev(value_range*, loop*, gimple*,
tree_node*)
        /home/buchmann/resources/gcc-8.3.0/gcc/vr-values.c:1751
0xf42fff evrp_range_analyzer::record_ranges_from_phis(basic_block_def*)
        /home/buchmann/resources/gcc-8.3.0/gcc/gimple-ssa-evrp-analyze.c:265
0xf43ccb evrp_range_analyzer::enter(basic_block_def*)
        /home/buchmann/resources/gcc-8.3.0/gcc/gimple-ssa-evrp-analyze.c:76
0xf41c0c evrp_dom_walker::before_dom_children(basic_block_def*)
        /home/buchmann/resources/gcc-8.3.0/gcc/gimple-ssa-evrp.c:99
0xf27977 dom_walker::walk(basic_block_def*)
        /home/buchmann/resources/gcc-8.3.0/gcc/domwalk.c:353
0xf42751 execute_early_vrp
        /home/buchmann/resources/gcc-8.3.0/gcc/gimple-ssa-evrp.c:302
0xf42751 execute
        /home/buchmann/resources/gcc-8.3.0/gcc/gimple-ssa-evrp.c:339
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
------------------------------------------

../tc/bin/nios2-linux-gnu-g++ -v

------------------------------------------
Using built-in specs.
COLLECT_GCC=../tc/bin/nios2-linux-gnu-g++
COLLECT_LTO_WRAPPER=/home/adm/hans.buchmann/qsc/arch/nios2/tc/bin/../libexec/gcc/nios2-linux-gnu/8.3.0/lto-wrapper
Target: nios2-linux-gnu
Configured with: /home/buchmann/resources/gcc-8.3.0/configure
--prefix=/home/buchmann/devel/superfluous/eo3s/nios2/tc-build/../tc 
--with-gmp=/home/buchmann/devel/superfluous/eo3s/nios2/tc-build/../tc 
--with-mpfr=/home/buchmann/devel/superfluous/eo3s/nios2/tc-build/../tc 
--with-mpc-include=/home/buchmann/devel/superfluous/eo3s/nios2/tc-build/../tc/include
 
--with-mpc-lib=/home/buchmann/devel/superfluous/eo3s/nios2/tc-build/../tc/lib 
--target=nios2-linux-gnu 
--disable-nls 
--disable-werror 
--enable-languages=c,c++ 
--disable-threads 
--disable-nls 
--disable-__cxa_atexit 
--with-as=/home/buchmann/devel/superfluous/eo3s/nios2/tc-build/../tc/nios2-linux-gnu/bin//as
 
--with-ld=/home/buchmann/devel/superfluous/eo3s/nios2/tc-build/../tc/nios2-linux-gnu/bin//ld
 
--with-newlib 
--with-sysroot 
--without-headers 
--disable-libssp 
--enable-lto 
--disable-shared
Thread model: single
gcc version 8.3.0 (GCC) 


Some remarks:
 - the -O2 seems to be relevant
 - Surprisingly the crash occurs only with libmpfr.so.6
 - uname -a
    Linux v000090 3.10.0-514.el7.x86_64 #1 SMP 
    Wed Oct 19 11:24:13 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

Sincerely 

Hans Buchmann

Reply via email to