Skip to content

Commit

Permalink
Trac #24599: Internal compiler error when compiling giac-1.4.9.45 wit…
Browse files Browse the repository at this point in the history
…h gcc-7.2.0

gcc-7.2.0 is currently distributed with Sage. Complete log is attached.
{{{
[giac-1.4.9.45] modpoly.cc: In function 'std::complex<double>
giac::horner_newton(const vecteur&, const std::complex<double>&, const
giac::context*)':
[giac-1.4.9.45] modpoly.cc:5035:19: internal compiler error: Aborted
[giac-1.4.9.45]    complex<double> horner_newton(const vecteur & p,const
std::complex<double> &x,GIAC_CONTEXT){
[giac-1.4.9.45]                    ^~~~~~~~~~~~~
[giac-1.4.9.45] 0xafbc6f crash_signal
[giac-1.4.9.45]         ../../src/gcc/toplev.c:337
[giac-1.4.9.45] 0x7f3e0cfeedd3 mpfr_assert_fail
[giac-1.4.9.45]
/home/ralf/sage/local/var/tmp/sage/build/mpfr-3.1.5.p0/src/src/mpfr-
gmp.c:305
[giac-1.4.9.45] 0x7f3e0cfe59c1 mpfr_init2
[giac-1.4.9.45]         /home/ralf/sage/local/var/tmp/sage/build/mpfr-3.
1.5.p0/src/src/init2.c:52
[giac-1.4.9.45] 0x7f3e0d21b472 mpc_div_zero
[giac-1.4.9.45]
/home/ralf/sage/local/var/tmp/sage/build/mpc-1.1.0/src/src/div.c:31
[giac-1.4.9.45] 0x7f3e0d21b472 mpc_div
[giac-1.4.9.45]
/home/ralf/sage/local/var/tmp/sage/build/mpc-1.1.0/src/src/div.c:257
[giac-1.4.9.45] 0x77b6b9 do_mpc_arg2(tree_node*, tree_node*, tree_node*,
int, int (*)(__mpc_struct*, __mpc_struct const*, __mpc_struct const*,
int))
[giac-1.4.9.45]         ../../src/gcc/builtins.c:10179
[giac-1.4.9.45] 0x8afa0a const_binop
[giac-1.4.9.45]         ../../src/gcc/fold-const.c:1316
[giac-1.4.9.45] 0x8b0c5e const_binop(tree_code, tree_node*, tree_node*,
tree_node*)
[giac-1.4.9.45]         ../../src/gcc/fold-const.c:1565
[giac-1.4.9.45] 0xdb4962 gimple_resimplify2(gimple**, code_helper*,
tree_node*, tree_node**, tree_node* (*)(tree_node*))
[giac-1.4.9.45]         ../../src/gcc/gimple-match-head.c:132
[giac-1.4.9.45] 0xe384b0 gimple_simplify(gimple*, code_helper*,
tree_node**, gimple**, tree_node* (*)(tree_node*), tree_node*
(*)(tree_node*))
[giac-1.4.9.45]         ../../src/gcc/gimple-match-head.c:642
[giac-1.4.9.45] 0x8e4306 fold_stmt_1
[giac-1.4.9.45]         ../../src/gcc/gimple-fold.c:4362
[giac-1.4.9.45] 0xbdb5ff execute
[giac-1.4.9.45]         ../../src/gcc/tree-ssa-forwprop.c:2391
[giac-1.4.9.45] Please submit a full bug report,
}}}

Minimal crashing example:
{{{
#include <complex>
auto inf = 1.0 / std::complex<double>();
}}}

The underlying reason is that, in #24353, the MPC upgrade '''did not
change''' the `.so` version number but the MPFR upgrade '''did change'''
the `.so` version number. So now GCC is linking with the old MPFR but
the new MPC which is what causes the breakage...

URL: https://trac.sagemath.org/24599
Reported by: rws
Ticket author(s): Jeroen Demeyer
Reviewer(s): Ralf Stephan
  • Loading branch information
Release Manager authored and vbraun committed Feb 1, 2018
2 parents 07f53b2 + c7b0dac commit 129faa0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build/pkgs/gcc/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| $(MP_LIBRARY) mpfr mpc zlib xz
$(MP_LIBRARY) mpfr mpc zlib | xz

----------
All lines of this file are ignored except the first.
Expand Down
13 changes: 13 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,19 @@ need_to_install_gfortran=no
if test -f "$SAGE_LOCAL/bin/gcc"; then
# Special value for SAGE_INSTALL_GCC if GCC is already installed
SAGE_INSTALL_GCC=exists

# Check whether it actually works...
# See https://trac.sagemath.org/ticket/24599
if test -x "$SAGE_LOCAL/bin/g++"; then
echo '#include <complex>' >conftest.cpp
echo 'auto inf = 1.0 / std::complex<double>();' >>conftest.cpp

if ! bash -c "source '$SAGE_LOCAL/bin/sage-env' && g++ -O3 -c -o conftest.o conftest.cpp"; then
SAGE_INSTALL_GCC=yes
SAGE_MUST_INSTALL_GCC([installed g++ is broken])
fi
rm -f conftest.*
fi
elif test -n "$SAGE_INSTALL_GCC"; then
# Check the value of the environment variable SAGE_INSTALL_GCC
case "$SAGE_INSTALL_GCC" in
Expand Down

0 comments on commit 129faa0

Please sign in to comment.