Bug 55714

Summary: gentoo sys-devel/llvm-3.1r2 compilation segfaults x86_64-pc-linux-gnux32-g++
Product: gcc Reporter: piotr5
Component: targetAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: normal Keywords: ice-on-valid-code
Priority: P3    
Version: 4.7.2   
Target Milestone: ---   
Host: Target: x86_64-pc-linux-gnux32
Build: Known to work:
Known to fail: Last reconfirmed: 2012-12-17 00:00:00
Attachments: the requested preprocessor output

Description piotr5 2012-12-17 03:48:18 UTC
reported this in gentoo, originally it happened with version 4.7.1. 
now I did do
/usr/bin/x86_64-pc-linux-gnux32-g++-4.7.2 -I/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/include -I/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/Target/X86  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS   -fvisibility-inlines-hidden -fno-exceptions -fPIC -Woverloaded-virtual -Wcast-qual -march=native -O2  -I/usr/libx32/libffi-3.0.11/include    -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings   -c -MMD -MP -MF "/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/Target/X86/Release/X86ELFWriterInfo.d.tmp" -MT "/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/Target/X86/Release/X86ELFWriterInfo.o" -MT "/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/Target/X86/Release/X86ELFWriterInfo.d" X86ELFWriterInfo.cpp -o /var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/Target/X86/Release/X86ELFWriterInfo.o -wrapper gdb,--args

and what happened was

Starting program: /usr/libexec/gcc/x86_64-pc-linux-gnux32/4.7.2/cc1plus -quiet -I /var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/include -I /var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/Target/X86 -I /usr/libx32/libffi-3.0.11/include -MMD /var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/Target/X86/Release/X86ELFWriterInfo.d -MF /var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/Target/X86/Release/X86ELFWriterInfo.d.tmp -MP -MT /var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/Target/X86/Release/X86ELFWriterInfo.o -MT /var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/Target/X86/Release/X86ELFWriterInfo.d -D_GNU_SOURCE -D NDEBUG -D _GNU_SOURCE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS X86ELFWriterInfo.cpp -march=atom -mcx16 -msahf -mmovbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rdrnd -mno-f16c -mno-fsgsbase --param l1-cache-size=24 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=atom -quiet -dumpbase X86ELFWriterInfo.cpp -auxbase-strip /var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/Target/X86/Release/X86ELFWriterInfo.o -O2 -Woverloaded-virtual -Wcast-qual -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fvisibility-inlines-hidden -fno-exceptions -fPIC -o /tmp/ccVhP6IA.s

then I got Program received signal SIGSEGV, Segmentation fault.

(gdb) bt
#0  0x00a04dc9 in distance_non_agu_define_in_bb(unsigned int, unsigned int, rtx_def*, int, rtx_def*, bool*) ()
#1  0x00a050b6 in ix86_lea_outperforms(rtx_def*, unsigned int, unsigned int, unsigned int, int) ()
#2  0x00000000 in ?? ()


without the debug-options I would get

X86ELFWriterInfo.cpp: In Elementfunktion ��virtual long int llvm::X86ELFWriterInfo::getDefaultAddendForRelTy(unsigned int, long int) const��:
X86ELFWriterInfo.cpp:85:1: interner Compiler-Fehler: Speicherzugriffsfehler

in the directory /var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/Target/X86

hope this helps
Comment 1 Andrew Pinski 2012-12-17 03:53:08 UTC
Can you attach the preprocessed source that crashes GCC?
Comment 2 Uroš Bizjak 2012-12-17 08:48:24 UTC
Duplicate of PR 43631.

*** This bug has been marked as a duplicate of bug 43631 ***
Comment 3 piotr5 2012-12-22 12:11:52 UTC
Created attachment 29026 [details]
the requested preprocessor output

youn probably are right it's a duplicate, using no optimization, or using anything else than "atom" for the -march option gives no such error. attached the output of the -E option nonetheless, just to make sure it's really the duplicate. un-bzip it and do

/usr/bin/x86_64-pc-linux-gnux32-g++-4.7.2 -march=atom -O2     -c X86ELFWriterInfo.cc -o X86ELFWriterInfo.o