NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/51586: internal compiler error
The following reply was made to PR bin/51586; it has been noted by GNATS.
From: sdhoya <sdhoya%z-planet.co.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: bin/51586: internal compiler error
Date: Mon, 31 Oct 2016 18:15:23 +0900
On Mon, 31 Oct 2016 03:55:02 +0000 (UTC)
David Holland <dholland-bugs%netbsd.org@localhost> wrote:
> Curious... can you extract the generated assembly, and find the exact
> way it's invoking as? If you run as directly on the assembly file with
> the same arguments, does it still crash?
>
> (use -S to compile to assembly, -v to show the invocation)
thank you, result follows...
$ cat Makefile
PROG=main
SRCS=main.c
NOMAN=1
DBG+=-v
.include <bsd.prog.mk>
main.s: main.c
gcc -O2 -v -fPIE -std=gnu99 -S main.c
main.o: main.s
gcc -v -fPIE -std=gnu99 -c main.s
$ cat main.c
#include <stdio.h>
int main()
{
printf("compiler ok\n");
return 0;
}
$ make
rm -f .gdbinit
touch .gdbinit
gcc -O2 -v -fPIE -std=gnu99 -S main.c
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64--netbsd
Configured with: /usr/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=x86_64--netbsd --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb1 20160606' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads --with-tune=nocona --with-diagnostics-color=auto-if-env --with-mpc-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/src/external/lgpl3/gmp/lib/libgmp/arch/x86_64 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd7.0 --host=x86_64--netbsd --with-sysroot=/var/obj/mknative/amd64-x86
_64/usr/src/destdir.amd64
Thread model: posix
gcc version 5.4.0 (nb1 20160606)
COLLECT_GCC_OPTIONS='-O2' '-v' '-fPIE' '-std=gnu99' '-S' '-mtune=nocona' '-march=x86-64'
/usr/libexec/cc1 -quiet -v main.c -quiet -dumpbase main.c -mtune=nocona -march=x86-64 -auxbase main -O2 -std=gnu99 -version -fPIE -o main.s
GNU C99 (nb1 20160606) version 5.4.0 (x86_64--netbsd)
compiled by GNU C version 5.4.0, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
#include "..." search starts here:
#include <...> search starts here:
/usr/include/gcc-5
/usr/include
End of search list.
GNU C99 (nb1 20160606) version 5.4.0 (x86_64--netbsd)
compiled by GNU C version 5.4.0, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c65940dbff8f1f236f75b65716e6d605
COMPILER_PATH=/usr/libexec/
LIBRARY_PATH=/usr/lib/
COLLECT_GCC_OPTIONS='-O2' '-v' '-fPIE' '-std=gnu99' '-S' '-mtune=nocona' '-march=x86-64'
gcc -v -fPIE -std=gnu99 -c main.s
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64--netbsd
Configured with: /usr/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=x86_64--netbsd --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb1 20160606' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads --with-tune=nocona --with-diagnostics-color=auto-if-env --with-mpc-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/src/external/lgpl3/gmp/lib/libgmp/arch/x86_64 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd7.0 --host=x86_64--netbsd --with-sysroot=/var/obj/mknative/amd64-x86
_64/usr/src/destdir.amd64
Thread model: posix
gcc version 5.4.0 (nb1 20160606)
COLLECT_GCC_OPTIONS='-v' '-fPIE' '-std=gnu99' '-c' '-mtune=nocona' '-march=x86-64'
as -v -o main.o main.s
GNU assembler version 2.26.1 (x86_64--netbsd) using BFD version (NetBSD Binutils nb1) 2.26.1
gcc: internal compiler error: Segmentation fault (program as received signal 11)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://www.NetBSD.org/support/send-pr.html> for instructions.
*** Error code 4
Stop.
make: stopped in /export/stage/main
$ gdb /usr/bin/as as.core
GNU gdb (GDB) 7.12
Copyright (C) 2016 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--netbsd".
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 /usr/bin/as...(no debugging symbols found)...done.
[New process 1]
Core was generated by `as'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000071a148d0c056 in strcmp () from /usr/lib/libc.so.12
(gdb) bt
#0 0x000071a148d0c056 in strcmp () from /usr/lib/libc.so.12
#1 0x00000000b8a3b358 in md_begin ()
#2 0x00000000b8a5df26 in main ()
(gdb) quit
$ cat main.s
.file "main.c"
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "compiler ok"
.section .text.unlikely,"ax",@progbits
.LCOLDB1:
.section .text.startup,"ax",@progbits
.LHOTB1:
.globl main
.type main, @function
main:
.LFB3:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
leaq .LC0(%rip), %rdi
call puts@PLT
xorl %eax, %eax
addq $8, %rsp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE3:
.size main, .-main
.section .text.unlikely
.LCOLDE1:
.section .text.startup
.LHOTE1:
.ident "GCC: (nb1 20160606) 5.4.0"
$ as -v -o main.o main.s
GNU assembler version 2.26.1 (x86_64--netbsd) using BFD version (NetBSD Binutils nb1) 2.26.1
[1] Segmentation fault (core dumped) as -v -o main.o main.s
$ ldd /usr/bin/as
/usr/bin/as:
-lopcodes.7 => /usr/lib/libopcodes.so.7
-lc.12 => /usr/lib/libc.so.12
-lbfd.14 => /usr/lib/libbfd.so.14
-lz.1 => /usr/lib/libz.so.1
-lintl.1 => /usr/lib/libintl.so.1
-lm.0 => /usr/lib/libm.so.0
----
DOYASHIKI Shinichi <sdhoya%z-planet.co.jp@localhost>
Home |
Main Index |
Thread Index |
Old Index