https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66247
Bug ID: 66247
Summary: make check-gmp fails for gcc-5.1.0
Product: gcc
Version: 5.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: mlmar...@clearsky-data.com
Target Milestone: ---
Created attachment 35592
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35592&action=edit
Preprocessor output
It appears that a pre-fetch at the bottom of a loop walks off the end of
addressable memory. Setting -fno-aggressive-loop-optimizations does change the
behavior by moving the loop comparison to the bottom of the loop and forcing
the next page to be allocated.
$ uname -a
Linux vm-mlmartin-5-1.clearsky-data.net 3.13.9-5.clearsky.el7.centos.x86_64 #1
SMP Wed Aug 6 21:22:34 BST 2014 x86_64 x86_64 x86_64 GNU/Linux
$ /home/mlmartin/gcc-5.1.0-build/./prev-gcc/xgcc -v
Using built-in specs.
COLLECT_GCC=/home/mlmartin/gcc-5.1.0-build/./prev-gcc/xgcc
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-5.1.0/configure --prefix=/opt/clearsky
--enable-languages=c,c++ --disable-multilib --with-system-zlib
Thread model: posix
gcc version 5.1.0 (GCC)
$ pwd
/home/mlmartin/gcc-5.1.0-build/gmp/tests/mpz
$[mlmartin@vm-mlmartin-5-1 mpz]$ /home/mlmartin/gcc-5.1.0-build/./prev-gcc/xgcc
-B/home/mlmartin/gcc-5.1.0-build/./prev-gcc/
-B/opt/clearsky/x86_64-unknown-linux-gnu/bin/
-B/opt/clearsky/x86_64-unknown-linux-gnu/bin/
-B/opt/clearsky/x86_64-unknown-linux-gnu/lib/ -isystem
/opt/clearsky/x86_64-unknown-linux-gnu/include -isystem
/opt/clearsky/x86_64-unknown-linux-gnu/sys-include-DHAVE_CONFIG_H -I.
-I../../../../gcc-5.1.0/gmp/tests/mpz -I../.. -I../../../../gcc-5.1.0/gmp
-I../../../../gcc-5.1.0/gmp/tests -DNO_ASM -Wall -Wextra -fwrapv -g -O2
-gtoggle -c ../../../../gcc-5.1.0/gmp/tests/mpz/t-scan.c -save-temps
In file included from ../../../../gcc-5.1.0/gmp/tests/mpz/t-scan.c:23:0:
../../../../gcc-5.1.0/gmp/gmp-impl.h: In function ‘mpn_toom33_mul_itch’:
../../../../gcc-5.1.0/gmp/gmp-impl.h:980:46: warning: unused parameter ‘bn’
[-Wunused-parameter]
mpn_toom33_mul_itch (mp_size_t an, mp_size_t bn)
^
../../../../gcc-5.1.0/gmp/gmp-impl.h: In function ‘mpn_toom44_mul_itch’:
../../../../gcc-5.1.0/gmp/gmp-impl.h:989:46: warning: unused parameter ‘bn’
[-Wunused-parameter]
mpn_toom44_mul_itch (mp_size_t an, mp_size_t bn)
^
../../../../gcc-5.1.0/gmp/tests/mpz/t-scan.c: In function ‘main’:
../../../../gcc-5.1.0/gmp/tests/mpz/t-scan.c:124:11: warning: unused parameter
‘argc’ [-Wunused-parameter]
main (int argc, char *argv[])
^
../../../../gcc-5.1.0/gmp/tests/mpz/t-scan.c:124:23: warning: unused parameter
‘argv’ [-Wunused-parameter]
main (int argc, char *argv[])
^
$ ./t-scan
Segmentation fault (core dumped)
[mlmartin@vm-mlmartin-5-1 mpz]$ gdb ./t-scan
core.t-scan.13359.vm-mlmartin-5-1.clearsky-data.net.1432223828
GNU gdb (GDB) 7.8
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./t-scan...done.
[New LWP 13359]
Core was generated by `./t-scan'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00400f80 in check_ref ()
(gdb) disassemble
Dump of assembler code for function check_ref:
0x00400e70 <+0>: push %r15
0x00400e72 <+2>: push %r14
0x00400e74 <+4>: push %r13
0x00400e76 <+6>: push %r12
0x00400e78 <+8>: push %rbp
0x00400e79 <+9>: push %rbx
0x00400e7a <+10>:mov$0x4153c4,%ebp
0x00400e7f <+15>:sub$0x18,%rsp
0x00400e83 <+19>:mov%rsp,%rdi
0x00400e86 <+22>:callq 0x404b20 <__gmpz_init>
0x00400e8b <+27>:xor%esi,%esi
0x00400e8d <+29>:mov%rsp,%rdi
0x00400e90 <+32>:callq 0x4053c0 <__gmpz_random2>
0x00400e95 <+37>:mov$0xfffe,%esi
0x00400e9a <+42>: