Bug#804002: libxcb FTBFS on mips: cc1 segfaults building xkb.c

Aurelien Jarno <[email protected]>
Newsgroups gmane.linux.debian.devel.gcc,gmane.linux.debian.ports.mips
Message-ID <[email protected]>
control: reassign -1 gcc-5
control: affects -1 libxcb
control: forwarded -1 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68302

On 2015-11-06 07:52, Helmut Grohne wrote:
> On Wed, Nov 04, 2015 at 06:26:01AM +0100, Helmut Grohne wrote:
> > | libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../src -D_FORTIFY_SOURCE=2 -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wlogical-op -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c xkb.c -o xkb.o
> > | gcc: internal compiler error: Segmentation fault (program cc1)
> > | Please submit a full bug report,
> > | with preprocessed source if appropriate.
> > | See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
> > | Makefile:996: recipe for target 'xkb.lo' failed
> > 
> > The attached file xkb.pre.c is the result of running the same invocation
> > past the preprocessor. Running gcc -g -O2 xkb.pre.c also gives that
> > segfault. Dropping either -g or -O2 or using -O1 or -O3 makes it go
> > away. Thus I cc [email protected]. This is gcc-5 5.2.1-23.
> 
> I am attaching a reduced file crash.c that reproduces the crash with
> just 28 lines and no includes. It seems that the bug is in the code
> generator or optimizer, because we can only observe a crash for mips and
> subtle changes make the issue disappear. Judging from a quick glance at
> a traceback (w/o debug symbols), the issue at hand is a stack space
> exhaustion of two mutually recursive functions. That's all I know for
> now.

Thanks for the reduced testcase. The problem is reproducible with gcc
trunk from today on both mips and mipsel. One need to add
-march=mips32r2 to reproduce the issue on mipsel as it is not (yet)
the default there.

I have reported the bug upstream, and I am re-affecting this bug to
gcc-5 as the bug is actually there.

Aurelien
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.