[Bug pending/37879] New: g++: internal compiler error: Segmentation fault
gcc-bugzilla at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Oct 21 07:10:00 GMT 2008
NOTE: Defaulting component because reported component no longer exists
ICE: Segmentation fault when compiling with an incorrect used
__attribute__((noreturn));
Environment:
System: Linux molybdaen 2.6.26-1-686 #1 SMP Wed Sep 10 16:46:13 UTC 2008 i686
GN
U/Linux
host: i486-pc-linux-gnu
build: i486-pc-linux-gnu
target: i486-pc-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.1-9'
--with-b
ugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran
,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib
--libexecdir=/usr
/lib --without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-i
nclude-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu
--ena
ble-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all
--enable
-cld --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu
--ta
rget=i486-linux-gnu
Thread model: posix
gcc version 4.3.1 (Debian 4.3.1-9)
How-To-Repeat:
source code (preprocessed file looks the same):
inline unsigned f( unsigned i ) { return i; }
unsigned i = 23;
static inline void g( unsigned ) __attribute__((noreturn));
static inline void g( unsigned j ) { if( j ) asm ("hlt"); }
void main_func() asm("main_func") __attribute__((noreturn));
void main_func()
{
unsigned j;
g( f( j = i++ ) );
asm("hlt");
}
compile with:
g++ -save-temps -m32 -MD -Os -ffunction-sections -fstrict-aliasing
-fno-rtti
-fno-exceptions -fcheck-new -fshort-enums --param max-inline-insns-single=100
-
mregparm=3 -fomit-frame-pointer -minline-all-stringops -nostdinc -ggdb
-Wconver
sion -Wctor-dtor-privacy -Wdeprecated -Winvalid-offsetof -Wnon-template-friend
-
Wold-style-cast -Woverloaded-virtual -Wpmf-conversions -Wreorder -Wsign-promo
-W
strict-null-sentinel -Wsynth -Waggregate-return -Wattributes -Wcast-align
-Wdepr
ecated-declarations -Wextra -Winline -Wmissing-noreturn -Wpacked -Wshadow
-Wstac
k-protector -Wstrict-aliasing -Wswitch -Wswitch-default -Wswitch-enum
-Wsystem-h
eaders -Wunsafe-loop-optimizations -Wvolatile-register-var
-Wdisabled-optimizati
on -Wformat -Wreturn-type -Wno-non-virtual-dtor -Wuninitialized -c -o
segfault.o
segfault.cc
------- Comment #1 from benjamin at os dot inf dot tu-dresden dot de 2008-10-21 07:09 -------
Fix:
use __attribute__((noreturn)) correctly
--
Summary: g++: internal compiler error: Segmentation fault
Product: gcc
Version: 3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: pending
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: benjamin at os dot inf dot tu-dresden dot de
GCC build triplet: i486-pc-linux-gnu
GCC host triplet: i486-pc-linux-gnu
GCC target triplet: i486-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37879
More information about the Gcc-bugs
mailing list