Bug 21786 - Segmentation fault under FreeBSD 5.3-RELEASE-p15
Summary: Segmentation fault under FreeBSD 5.3-RELEASE-p15
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 3.4.5
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-05-27 16:02 UTC by Gábor Kövesdán
Modified: 2016-09-07 08:10 UTC (History)
2 users (show)

See Also:
Host: amd64
Target: amd64
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Preprocessed elf.c (59.47 KB, text/plain)
2005-05-27 17:23 UTC, Gábor Kövesdán
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gábor Kövesdán 2005-05-27 16:02:48 UTC
While doing a full recompile of the whole FreeBSD 5.3-RELEASE-p15 source tree
the gcc 3.4.5 snapshot crashed with a segfault.



The comamnd line that triggered the error:

/usr/local/bin/gcc34 -s -Os -pipe -march=athlon64 -I.
-I/usr/src/gnu/usr.bin/binutils/libbfd
-I/usr/src/gnu/usr.bin/binutils/libbfd/../libbfd
-I/usr/obj/usr/src/amd64/usr/src/gnu/usr.bin/binutils/libbfd/../libbfd
-I/usr/src/gnu/usr.bin/binutils/libbfd/../../../../contrib/binutils/include
-D_GNU_SOURCE
-I/usr/src/gnu/usr.bin/binutils/libbfd/../../../../contrib/binutils/bfd
-DSELECT_ARCHITECTURES="&bfd_i386_arch" -DHAVE_bfd_elf64_x86_64_vec
-DHAVE_bfd_elf32_i386_freebsd_vec -DSELECT_VECS=" &bfd_elf64_x86_64_vec
,&bfd_elf32_i386_freebsd_vec" -DDEFAULT_VECTOR=bfd_elf64_x86_64_vec 
-I/usr/obj/usr/src/amd64/legacy/usr/include -c
/usr/src/gnu/usr.bin/binutils/libbfd/../../../../contrib/binutils/bfd/elf.c
/usr/src/gnu/usr.bin/binutils/libbfd/../../../../contrib/binutils/bfd/elf.c: In
function `_bfd_elf_compute_section_file_positions':
/usr/src/gnu/usr.bin/binutils/libbfd/../../../../contrib/binutils/bfd/elf.c:3143:
internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
*** Error code 1



The snapshot version information:

root@server# /usr/local/bin/gcc34 -v
Reading specs from /usr/local/lib/gcc/x86_64-portbld-freebsd5.3/3.4.5/specs
Configured with: ./..//gcc-3.4-20050524/configure --disable-nls
--with-system-zlib --with-libiconv-prefix=/usr/local --program-suffix=34
--with-gxx-include-dir=/usr/local/lib/gcc/x86_64-portbld-freebsd5.3/3.4.5/include/c++/
--disable-shared --disable-libgcj --prefix=/usr/local x86_64-portbld-freebsd5.3
Thread model: posix
gcc version 3.4.5 20050524 (prerelease) [FreeBSD]



The uname -a output of the computer:

root@server# uname -a
FreeBSD server.t-hosting.hu 5.3-RELEASE-p15 FreeBSD 5.3-RELEASE-p15 #0: Thu May
26 14:21:20 CEST 2005    
root@server.t-hosting.hu:/usr/src/sys/amd64/compile/FREEBSD  amd64


The used macros and flags:

CC=/usr/local/bin/gcc34
CFLAGS=-s -Os -pipe -march=athlon64
COPTFLAGS=-s -Os -march=athlon64 -pipe



The same code compiles in same circumstances with the stock gcc 3.4.2. If You
need further information, contact me.

Regards,

Gábor Kövesdán
Comment 1 Andrew Pinski 2005-05-27 17:05:39 UTC
Could you attach the preprocessed source like it says to do on the web page?
Comment 2 Gábor Kövesdán 2005-05-27 17:23:44 UTC
Created attachment 8981 [details]
Preprocessed elf.c

This is the preprocessed elf.c that caused the segfault.
Comment 3 Andrew Pinski 2005-10-24 01:42:29 UTC
Seems fixed in "3.4.5 20050809".  Can you try a newer 3.4.5?
Comment 4 Gábor Kövesdán 2005-10-28 14:31:22 UTC
(In reply to comment #3)
> Seems fixed in "3.4.5 20050809".  Can you try a newer 3.4.5?
> 

It's okay now, but there's a build error. I susoect the code is not for gcc 3.4.5. I got this:

CC='/usr/local/bin/gcc34' mkdep -f .depend -a -DCRT_BEGIN   -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -I/usr/src/gnu/lib/csu/../../../contrib/gcc/config -I/usr/src/gnu/lib/csu/../../../contrib/gcc -I. -I/usr/src/gnu/lib/csu/../../usr.bin/cc/cc_tools /usr/src/gnu/lib/csu/../../../contrib/gcc/crtstuff.c
/usr/local/bin/gcc34 -s -Os -pipe -march=athlon64  -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -finhibit-size-directive -fno-inline-functions  -fno-exceptions -fno-zero-initialized-in-bss  -fno-omit-frame-pointer -fno-unit-at-a-time -I/usr/src/gnu/lib/csu/../../../contrib/gcc/config -I/usr/src/gnu/lib/csu/../../../contrib/gcc -I.  -I/usr/src/gnu/lib/csu/../../usr.bin/cc/cc_tools  -g0 -DCRT_BEGIN  -c -o crtbegin.o /usr/src/gnu/lib/csu/../../../contrib/gcc/crtstuff.c
/usr/local/bin/gcc34 -s -Os -pipe -march=athlon64  -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -finhibit-size-directive -fno-inline-functions  -fno-exceptions -fno-zero-initialized-in-bss  -fno-omit-frame-pointer -fno-unit-at-a-time -I/usr/src/gnu/lib/csu/../../../contrib/gcc/config -I/usr/src/gnu/lib/csu/../../../contrib/gcc -I.  -I/usr/src/gnu/lib/csu/../../usr.bin/cc/cc_tools  -g0 -DCRT_END  -c -o crtend.o /usr/src/gnu/lib/csu/../../../contrib/gcc/crtstuff.c
/usr/src/gnu/lib/csu/../../../contrib/gcc/crtstuff.c:451: error: mode `SI' applied to inappropriate type
*** Error code 1
Comment 5 Gerald Pfeifer 2007-08-25 14:57:48 UTC
FreeBSD upstream now switched to GCC 4.2.1 to rebuild the whole system,
so this problem was solved there.

Since GCC 3.4.x is no longer maintained by the GCC developers (GCC 4.0.x
being the oldest tree still open), I am thus going to close this as FIXED.
Comment 6 kargl 2009-12-16 18:31:09 UTC
(In reply to comment #5)
> FreeBSD upstream now switched to GCC 4.2.1 to rebuild the whole system,
> so this problem was solved there.
> 
> Since GCC 3.4.x is no longer maintained by the GCC developers (GCC 4.0.x
> being the oldest tree still open), I am thus going to close this as FIXED.
> 

Gerald,

You threaten to close this bug, but it appears to be open still.  Should
this be closed?

-- 
steve
Comment 7 Andrew Pinski 2016-09-07 08:10:34 UTC
Fixed so closing.