SIGSEGV with inline functions on Alpha - many version of egcs

Michal Jaegermann
Wed Oct 7 03:12:00 GMT 1998

This report describes a problem which I filed already twice but this
time there are more precise details.

Current versions of egcs, for quite a while and including the latest
release and the latest snapshot but not the previous release, have
problems on Linux/Alpha when inline functions and -O2 optimization
is present.

System - Linux/Alpha on EB64+ board, current kernel 2.0.36(pre).  

An included file slhc5.i is a result of trimming down to two functions
only, inline __ntohs and slhc_uncompress, of an intermediate file
created during a compilation of Linux kernel (original source from

The following command:

  ./cc1 slhc5.i -O2 -version -o slhc2.s

results in SIGSEGV from a compiler.  When optimization is reduced
to -O1, or when __ntohs is removed, then there are no compilation
problems.  Results from gdb seem to point out to a possibility that
if_then_else_cond() from combine.c goes into an infinite recursion
eventually running out of a stack space but I am not really sure
if I understand that properly.

I include a code file slhc5.i, results from a compilation when only
-O1 was used (slhcO1.s),  results from a compilation with -O2 but
with __ntohs deleted (slhcO2.s), and a sample trace from gdb session.
"Real" code contains, obviously, many other functions including
inline __ntohl which curiously enough does not seem be doing any harm.

  Hope this helps,
  Michal Jaegermann

-------------- next part --------------
A non-text attachment was scrubbed...
Name: inline_bug.tar.gz
Type: application/x-gzip
Size: 28599 bytes
Desc: not available
URL: <>

More information about the Gcc-bugs mailing list