https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65875
Bug ID: 65875 Summary: internal compiler error with gcc 5.1 Product: gcc Version: 5.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: megahallon at gmail dot com Created attachment 35394 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35394&action=edit Preprocessed C file causing gcc crash The enclosed file crashes gcc when compiled with -O2 as seen below. -O1 works. It works with gcc 4.9.0. $ gcc -v -O2 -c ~/gcc5.1bug.c Using built-in specs. COLLECT_GCC=gcc Target: x86_64-unknown-linux-gnu Configured with: ./configure --prefix=/usr/local --enable-languages=c,c++ --disable-multilib Thread model: posix gcc version 5.1.0 (GCC) COLLECT_GCC_OPTIONS='-v' '-O2' '-c' '-mtune=generic' '-march=x86-64' /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.1.0/cc1 -quiet -v /home/hallon/gcc5.1bug.c -quiet -dumpbase gcc5.1bug.c -mtune=generic -march=x86-64 -auxbase gcc5.1bug -O2 -version -o /tmp/cccJihQs.s GNU C11 (GCC) version 5.1.0 (x86_64-unknown-linux-gnu) compiled by GNU C version 5.1.0, GMP version 6.0.0, MPFR version 3.1.2, MPC version 1.0.3 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring nonexistent directory "/usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/../../../../x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/include /usr/local/include /usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/include-fixed /usr/include End of search list. GNU C11 (GCC) version 5.1.0 (x86_64-unknown-linux-gnu) compiled by GNU C version 5.1.0, GMP version 6.0.0, MPFR version 3.1.2, MPC version 1.0.3 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 2f2bc89784971300bbbb2cc329f649d8 src/sets/bitset.c: In function ‘mutbitset_iop_PyLongObject’: src/sets/bitset.c:2021:20: warning: passing argument 1 of ‘_PyLong_Frexp’ from incompatible pointer type [-Wincompatible-pointer-types] In file included from /srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/Python.h:88:0, from src/sets/bitset.c:3: /srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/longobject.h:43:8: note: expected ‘PyLongObject * {aka struct _longobject *}’ but argument is of type ‘PyObject * {aka struct _object *}’ src/sets/bitset.c:2021:23: warning: passing argument 2 of ‘_PyLong_Frexp’ from incompatible pointer type [-Wincompatible-pointer-types] In file included from /srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/Python.h:88:0, from src/sets/bitset.c:3: /srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/longobject.h:43:8: note: expected ‘Py_ssize_t * {aka long int *}’ but argument is of type ‘int *’ src/sets/bitset.c:2034:20: warning: passing argument 1 of ‘_PyLong_Frexp’ from incompatible pointer type [-Wincompatible-pointer-types] In file included from /srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/Python.h:88:0, from src/sets/bitset.c:3: /srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/longobject.h:43:8: note: expected ‘PyLongObject * {aka struct _longobject *}’ but argument is of type ‘PyObject * {aka struct _object *}’ src/sets/bitset.c:2034:23: warning: passing argument 2 of ‘_PyLong_Frexp’ from incompatible pointer type [-Wincompatible-pointer-types] In file included from /srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/Python.h:88:0, from src/sets/bitset.c:3: /srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/longobject.h:43:8: note: expected ‘Py_ssize_t * {aka long int *}’ but argument is of type ‘int *’ src/sets/bitset.c: In function ‘sf_slice’: src/sets/bitset.c:2985:1: internal compiler error: Segmentation fault 0x9bab0f crash_signal ../.././gcc/toplev.c:383 0xb73110 compare_values_warnv ../.././gcc/tree-vrp.c:1337 0xb7371c compare_values ../.././gcc/tree-vrp.c:1533 0xb833bc vrp_visit_phi_node ../.././gcc/tree-vrp.c:8879 0xad932d simulate_stmt ../.././gcc/tree-ssa-propagate.c:344 0xad9467 process_ssa_edge_worklist ../.././gcc/tree-ssa-propagate.c:422 0xada1fd ssa_propagate(ssa_prop_result (*)(gimple_statement_base*, edge_def**, tree_node**), ssa_prop_result (*)(gphi*)) ../.././gcc/tree-ssa-propagate.c:896 0xb7b394 execute_vrp ../.././gcc/tree-vrp.c:10367 0xb7b394 execute ../.././gcc/tree-vrp.c:10447