https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79027
Bug ID: 79027 Summary: fold-const.c:11104:1: internal compiler error: Floating point exception Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: danglin at gcc dot gnu.org CC: deller at gmx dot de Target Milestone: --- Host: hppa-unknown-linux-gnu Target: hppa-unknown-linux-gnu Build: hppa-unknown-linux-gnu Created attachment 40479 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40479&action=edit Preprocessed source The build fails on trunk: /home/dave/gnu/gcc/objdir/./prev-gcc/xg++ -B/home/dave/gnu/gcc/objdir/./prev-gcc / -B/home/dave/opt/gnu/gcc/gcc-7/hppa-linux-gnu/bin/ -nostdinc++ -B/home/dave/gn u/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/src/.libs -B/home/dave/gnu/gcc/obj dir/prev-hppa-linux-gnu/libstdc++-v3/libsupc++/.libs -I/home/dave/gnu/gcc/objdi r/prev-hppa-linux-gnu/libstdc++-v3/include/hppa-linux-gnu -I/home/dave/gnu/gcc/ objdir/prev-hppa-linux-gnu/libstdc++-v3/include -I/home/dave/gnu/gcc/gcc/libstd c++-v3/libsupc++ -L/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/sr c/.libs -L/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/libsupc++/. libs -fno-PIE -c -g -O2 -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous- unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-form at-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc /gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/incl ude -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../li bdecnumber -I../../gcc/gcc/../libbacktrace -o fold-const.o -MT fold-const.o -M MD -MP -MF ./.deps/fold-const.TPo ../../gcc/gcc/fold-const.c ../../gcc/gcc/fold-const.c: In function ‘tree_node* fold_binary_loc(location_t, tree_code, tree, tree, tree)’: ../../gcc/gcc/fold-const.c:11104:1: internal compiler error: Floating point exce ption } ^ 0x14fb0af crash_signal ../../gcc/gcc/toplev.c:333 With "-v -save-temps", more errors appear: dave@MACPRO:~$ cat xx.log Reading specs from /home/dave/gnu/gcc/objdir/./prev-gcc/specs COLLECT_GCC=/home/dave/gnu/gcc/objdir/./prev-gcc/xg++ Target: hppa-linux-gnu Configured with: ../gcc/configure --with-gnu-as --with-gnu-ld --enable-shared --enable-multiarch --enable-linker-build-id --build=hppa-linux-gnu --host=hppa-linux-gnu --target=hppa-linux-gnu --prefix=/home/dave/opt/gnu/gcc/gcc-7 --with-local-prefix=/home/dave/opt/gnu --enable-threads=posix --enable-__cxa_atexit --build=hppa-linux-gnu --enable-clocale=gnu --enable-languages=c,c++,objc,fortran,obj-c++,ada,lto,go Thread model: posix gcc version 7.0.0 20170108 (experimental) [trunk revision 244209] (GCC) COLLECT_GCC_OPTIONS='-B' '/home/dave/gnu/gcc/objdir/./prev-gcc/' '-B' '/home/dave/opt/gnu/gcc/gcc-7/hppa-linux-gnu/bin/' '-nostdinc++' '-B' '/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/src/.libs' '-B' '/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/libsupc++/.libs' '-I' '/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/include/hppa-linux-gnu' '-I' '/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/include' '-I' '/home/dave/gnu/gcc/gcc/libstdc++-v3/libsupc++' '-L/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/src/.libs' '-L/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/libsupc++/.libs' '-fno-PIE' '-c' '-g' '-O2' '-D' 'IN_GCC' '-fno-exceptions' '-fno-rtti' '-fasynchronous-unwind-tables' '-Wextra' '-Wall' '-Wno-narrowing' '-Wwrite-strings' '-Wcast-qual' '-Wsuggest-attribute=format' '-Woverloaded-virtual' '-Wpedantic' '-Wno-long-long' '-Wno-variadic-macros' '-Wno-overlength-strings' '-Werror' '-fno-common' '-D' 'HAVE_CONFIG_H' '-I' '.' '-I' '.' '-I' '../../gcc/gcc' '-I' '../../gcc/gcc/.' '-I' '../../gcc/gcc/../include' '-I' '../../gcc/gcc/../libcpp/include' '-I' '../../gcc/gcc/../libdecnumber' '-I' '../../gcc/gcc/../libdecnumber/dpd' '-I' '../libdecnumber' '-I' '../../gcc/gcc/../libbacktrace' '-o' 'fold-const.o' '-MT' 'fold-const.o' '-MMD' '-MP' '-MF' './.deps/fold-const.TPo' '-v' '-save-temps' '-shared-libgcc' /home/dave/gnu/gcc/objdir/./prev-gcc/cc1plus -E -quiet -nostdinc++ -v -I /home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/include/hppa-linux-gnu -I /home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/include -I /home/dave/gnu/gcc/gcc/libstdc++-v3/libsupc++ -I . -I . -I ../../gcc/gcc -I ../../gcc/gcc/. -I ../../gcc/gcc/../include -I ../../gcc/gcc/../libcpp/include -I ../../gcc/gcc/../libdecnumber -I ../../gcc/gcc/../libdecnumber/dpd -I ../libdecnumber -I ../../gcc/gcc/../libbacktrace -imultilib . -imultiarch hppa-linux-gnu -iprefix /home/dave/gnu/gcc/objdir/prev-gcc/../lib/gcc/hppa-linux-gnu/7.0.0/ -isystem /home/dave/gnu/gcc/objdir/./prev-gcc/include -isystem /home/dave/gnu/gcc/objdir/./prev-gcc/include-fixed -MMD fold-const.d -MF ./.deps/fold-const.TPo -MP -MT fold-const.o -D_GNU_SOURCE -D IN_GCC -D HAVE_CONFIG_H ../../gcc/gcc/fold-const.c -Wextra -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wsuggest-attribute=format -Woverloaded-virtual -Wpedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-PIE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -fno-common -g -fworking-directory -O2 -fpch-preprocess -o fold-const.ii ignoring nonexistent directory "/home/dave/gnu/gcc/objdir/prev-gcc/../lib/gcc/hppa-linux-gnu/7.0.0/include" ignoring nonexistent directory "/home/dave/gnu/gcc/objdir/prev-gcc/../lib/gcc/hppa-linux-gnu/7.0.0/include-fixed" ignoring nonexistent directory "/home/dave/gnu/gcc/objdir/prev-gcc/../lib/gcc/hppa-linux-gnu/7.0.0/../../../../hppa-linux-gnu/include" ignoring nonexistent directory "/home/dave/gnu/gcc/objdir/prev-gcc/../lib/gcc/../../lib/gcc/hppa-linux-gnu/7.0.0/include" ignoring nonexistent directory "/home/dave/opt/gnu/include/hppa-linux-gnu" ignoring nonexistent directory "/home/dave/gnu/gcc/objdir/prev-gcc/../lib/gcc/../../include" ignoring nonexistent directory "/home/dave/gnu/gcc/objdir/prev-gcc/../lib/gcc/../../lib/gcc/hppa-linux-gnu/7.0.0/include-fixed" ignoring nonexistent directory "/home/dave/gnu/gcc/objdir/prev-gcc/../lib/gcc/../../lib/gcc/hppa-linux-gnu/7.0.0/../../../../hppa-linux-gnu/include" ignoring duplicate directory "." ignoring duplicate directory "../../gcc/gcc/." #include "..." search starts here: #include <...> search starts here: /home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/include/hppa-linux-gnu /home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/include /home/dave/gnu/gcc/gcc/libstdc++-v3/libsupc++ . ../../gcc/gcc ../../gcc/gcc/../include ../../gcc/gcc/../libcpp/include ../../gcc/gcc/../libdecnumber ../../gcc/gcc/../libdecnumber/dpd ../libdecnumber ../../gcc/gcc/../libbacktrace /home/dave/gnu/gcc/objdir/./prev-gcc/include /home/dave/gnu/gcc/objdir/./prev-gcc/include-fixed /home/dave/opt/gnu/include /usr/include/hppa-linux-gnu /usr/include End of search list. COLLECT_GCC_OPTIONS='-B' '/home/dave/gnu/gcc/objdir/./prev-gcc/' '-B' '/home/dave/opt/gnu/gcc/gcc-7/hppa-linux-gnu/bin/' '-nostdinc++' '-B' '/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/src/.libs' '-B' '/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/libsupc++/.libs' '-I' '/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/include/hppa-linux-gnu' '-I' '/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/include' '-I' '/home/dave/gnu/gcc/gcc/libstdc++-v3/libsupc++' '-L/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/src/.libs' '-L/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/libsupc++/.libs' '-fno-PIE' '-c' '-g' '-O2' '-D' 'IN_GCC' '-fno-exceptions' '-fno-rtti' '-fasynchronous-unwind-tables' '-Wextra' '-Wall' '-Wno-narrowing' '-Wwrite-strings' '-Wcast-qual' '-Wsuggest-attribute=format' '-Woverloaded-virtual' '-Wpedantic' '-Wno-long-long' '-Wno-variadic-macros' '-Wno-overlength-strings' '-Werror' '-fno-common' '-D' 'HAVE_CONFIG_H' '-I' '.' '-I' '.' '-I' '../../gcc/gcc' '-I' '../../gcc/gcc/.' '-I' '../../gcc/gcc/../include' '-I' '../../gcc/gcc/../libcpp/include' '-I' '../../gcc/gcc/../libdecnumber' '-I' '../../gcc/gcc/../libdecnumber/dpd' '-I' '../libdecnumber' '-I' '../../gcc/gcc/../libbacktrace' '-o' 'fold-const.o' '-MT' 'fold-const.o' '-MMD' '-MP' '-MF' './.deps/fold-const.TPo' '-v' '-save-temps' '-shared-libgcc' /home/dave/gnu/gcc/objdir/./prev-gcc/cc1plus -fpreprocessed fold-const.ii -quiet -dumpbase fold-const.c -auxbase-strip fold-const.o -g -O2 -Wextra -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wsuggest-attribute=format -Woverloaded-virtual -Wpedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -version -fno-PIE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -fno-common -o fold-const.s GNU C++14 (GCC) version 7.0.0 20170108 (experimental) [trunk revision 244209] (hppa-linux-gnu) compiled by GNU C version 6.3.0 20161229, GMP version 6.1.2, MPFR version 3.1.5, MPC version 1.0.3, isl version 0.15 GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 GNU C++14 (GCC) version 7.0.0 20170108 (experimental) [trunk revision 244209] (hppa-linux-gnu) compiled by GNU C version 6.3.0 20161229, GMP version 6.1.2, MPFR version 3.1.5, MPC version 1.0.3, isl version 0.15 GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 Compiler executable checksum: 469653bacf19a93854ee98d4788c69d2 ../../gcc/gcc/fold-const.c: In function ‘tree_node* const_binop(tree_code, tree, tree)’: ../../gcc/gcc/fold-const.c:1290:4: error: this statement may fall through [-Werror=implicit-fallthrough=] if (COMPLEX_FLOAT_TYPE_P (type)) ^~ ../../gcc/gcc/fold-const.c:1295:2: note: here case TRUNC_DIV_EXPR: ^~~~ ../../gcc/gcc/fold-const.c: In function ‘tree_node* fold_negate_expr(location_t, tree)’: ../../gcc/gcc/fold-const.c:630:7: error: this statement may fall through [-Werror=implicit-fallthrough=] if (TYPE_UNSIGNED (type)) ^~ ../../gcc/gcc/fold-const.c:635:5: note: here case RDIV_EXPR: ^~~~ ../../gcc/gcc/fold-const.c: In function ‘bool negate_expr_p(tree)’: ../../gcc/gcc/fold-const.c:454:7: error: this statement may fall through [-Werror=implicit-fallthrough=] if (INTEGRAL_TYPE_P (TREE_TYPE (t)) ^~ ../../gcc/gcc/fold-const.c:464:5: note: here case RDIV_EXPR: ^~~~ ../../gcc/gcc/fold-const.c: In function ‘tree_node* fold_convert_loc(location_t, tree, tree)’: ../../gcc/gcc/fold-const.c:2217:7: error: this statement may fall through [-Werror=implicit-fallthrough=] if (POINTER_TYPE_P (orig) ^~ ../../gcc/gcc/fold-const.c:2223:5: note: here case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE: ^~~~ ../../gcc/gcc/fold-const.c: In function ‘int operand_equal_p(const_tree, const_tree, unsigned int)’: ../../gcc/gcc/fold-const.c:3017:4: error: this statement may fall through [-Werror=implicit-fallthrough=] if (!operand_equal_p (TYPE_SIZE (TREE_TYPE (arg0)), ^~ ../../gcc/gcc/fold-const.c:3023:2: note: here case REALPART_EXPR: ^~~~ ../../gcc/gcc/fold-const.c:3129:4: error: this statement may fall through [-Werror=implicit-fallthrough=] if (!OP_SAME (2)) ^~ ../../gcc/gcc/fold-const.c:3134:2: note: here case TRUTH_AND_EXPR: ^~~~ ../../gcc/gcc/fold-const.c:3017:4: error: this statement may fall through [-Werror=implicit-fallthrough=] if (!operand_equal_p (TYPE_SIZE (TREE_TYPE (arg0)), ^~ ../../gcc/gcc/fold-const.c:3023:2: note: here case REALPART_EXPR: ^~~~ ../../gcc/gcc/fold-const.c:3129:4: error: this statement may fall through [-Werror=implicit-fallthrough=] if (!OP_SAME (2)) ^~ ../../gcc/gcc/fold-const.c:3134:2: note: here case TRUTH_AND_EXPR: ^~~~ ../../gcc/gcc/fold-const.c: In function ‘bool merge_ranges(int*, tree_node**, tree_node**, int, tree, tree, int, tree, tree)’: ../../gcc/gcc/fold-const.c:4942:7: error: this statement may fall through [-Werror=implicit-fallthrough=] if (TYPE_PRECISION (TREE_TYPE (low0)) ^~ ../../gcc/gcc/fold-const.c:4946:5: note: here case INTEGER_TYPE: ^~~~ ../../gcc/gcc/fold-const.c:4965:7: error: this statement may fall through [-Werror=implicit-fallthrough=] if (TYPE_PRECISION (TREE_TYPE (high1)) ^~ ../../gcc/gcc/fold-const.c:4969:5: note: here case INTEGER_TYPE: ^~~~ ../../gcc/gcc/fold-const.c: In function ‘tree_node* fold_truth_not_expr(location_t, tree)’: ../../gcc/gcc/fold-const.c:3686:7: error: this statement may fall through [-Werror=implicit-fallthrough=] if (TREE_CODE (TREE_TYPE (arg)) == BOOLEAN_TYPE) ^~ ../../gcc/gcc/fold-const.c:3691:5: note: here case FLOAT_EXPR: ^~~~ ../../gcc/gcc/fold-const.c: In function ‘tree_node* fold_binary_loc(location_t, tree_code, tree, tree, tree)’: ../../gcc/gcc/fold-const.c:10084:2: error: this statement may fall through [-Werror=implicit-fallthrough=] } ^ ../../gcc/gcc/fold-const.c:10088:5: note: here case ROUND_DIV_EXPR: ^~~~ ../../gcc/gcc/fold-const.c:10218:7: error: this statement may fall through [-Werror=implicit-fallthrough=] if (integer_zerop (arg0)) ^~ ../../gcc/gcc/fold-const.c:10221:5: note: here case TRUTH_AND_EXPR: ^~~~ ../../gcc/gcc/fold-const.c:10274:7: error: this statement may fall through [-Werror=implicit-fallthrough=] if (TREE_CODE (arg0) == INTEGER_CST && ! integer_zerop (arg0)) ^~ ../../gcc/gcc/fold-const.c:10277:5: note: here case TRUTH_OR_EXPR: ^~~~ ../../gcc/gcc/fold-const.c: In function ‘tree_node* extract_muldiv_1(tree, tree, tree_code, tree, bool*)’: ../../gcc/gcc/fold-const.c:6005:7: error: this statement may fall through [-Werror=implicit-fallthrough=] if (tree_int_cst_sgn (c) == -1) ^~ ../../gcc/gcc/fold-const.c:6008:5: note: here case NEGATE_EXPR: ^~~~ ../../gcc/gcc/fold-const.c: In function ‘tree_node* contains_label_1(tree_node**, int*, void*)’: ../../gcc/gcc/fold-const.c:11119:22: error: this statement may fall through [-Werror=implicit-fallthrough=] *walk_subtrees = 0; ~~~~~~~~~~~~~~~^~~ ../../gcc/gcc/fold-const.c:11123:5: note: here default: ^~~~~~~ ../../gcc/gcc/fold-const.c: In function ‘tree_node* fold_cond_expr_with_comparison(location_t, tree, tree, tree, tree)’: ../../gcc/gcc/fold-const.c:5079:2: error: this statement may fall through [-Werror=implicit-fallthrough=] if (flag_trapping_math) ^~ ../../gcc/gcc/fold-const.c:5082:7: note: here case GE_EXPR: ^~~~ ../../gcc/gcc/fold-const.c:5090:2: error: this statement may fall through [-Werror=implicit-fallthrough=] if (flag_trapping_math) ^~ ../../gcc/gcc/fold-const.c:5093:7: note: here case LE_EXPR: ^~~~ ../../gcc/gcc/fold-const.c: In function ‘int multiple_of_p(tree, const_tree, const_tree)’: ../../gcc/gcc/fold-const.c:12451:7: error: this statement may fall through [-Werror=implicit-fallthrough=] if (!integer_pow2p (bottom)) ^~ ../../gcc/gcc/fold-const.c:12455:5: note: here case MULT_EXPR: ^~~~ ../../gcc/gcc/fold-const.c:12496:7: error: this statement may fall through [-Werror=implicit-fallthrough=] if ((TREE_CODE (TREE_TYPE (TREE_OPERAND (top, 0))) != INTEGER_TYPE) ^~ ../../gcc/gcc/fold-const.c:12503:5: note: here case SAVE_EXPR: ^~~~ ../../gcc/gcc/fold-const.c:12554:2: error: this statement may fall through [-Werror=implicit-fallthrough=] } ^ ../../gcc/gcc/fold-const.c:12558:5: note: here default: ^~~~~~~ ../../gcc/gcc/fold-const.c: In function ‘tree_node* fold_binary_loc(location_t, tree_code, tree, tree, tree)’: ../../gcc/gcc/fold-const.c:11104:1: internal compiler error: Floating point exception } ^ 0x14fb0af crash_signal ../../gcc/gcc/toplev.c:333 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.