This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

MORE : gcc 2.95 : internal compiler error with qt 1.44


Hi!
 
Here is the complete bug report including a .ii file with perrmission from
Troll Tech (www.troll.no) QT 1.44 is copyrighted by Troll Tech.

QT 1.44 causes an interrnal compiler error with QT 1.44.
 
My system :

Pentium II 233 Mhz
Linux 2.2.10
glibc 2.1.1
XFree 3.9.15
 
GCC used to compile qt 1.44:

Reading specs from /usr/lib/gcc-lib/i486-linux/2.95/specs 
gcc version 2.95 19990728 (release)          

GCC compiled with : 

./configure  --prefix=/usr --enable-shared --enable-threads i486-linux


Here is the compiler output including all compiler options. 

g++ -c -I/usr/src/redhat/BUILD/qt-1.44/include -I/usr/X11R6/include -pipe -O2 -fno-strength-reduce -O2 -fno-strength-reduce -fPIC  -o widgets/qmenubar.o widgets/qmenubar.cpp
widgets/qmenubar.cpp: In method `int QMenuBar::calculateRects(int = -1)':
widgets/qmenubar.cpp:541: Internal compiler error.
widgets/qmenubar.cpp:541: Please submit a full bug report.
widgets/qmenubar.cpp:541: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for instructions.
cpp: output pipe has been closed
make[1]: *** [widgets/qmenubar.o] Error 1   

This compiler error is only caused when compiling with -O2  AND!  -fPIC. 

The bug seems to depend on the EXACT location of the method in the source code.
I tried to cut & paste QMenuBar::calculateRects to the front of the source code
and the source COMPILED! I also tried to remove any methods from the source
code but the source compiled without internal compiler errors almost
everytime after removing only one single method.  It depends on the directory
the build is done too (which confused me very much). The building directory
affects the command line options for include files. The .ii is independed of
the include path - the include paths are already in there. Its probably I memory
corruption bug.

The internal compiler error is a SEGV which is catched by gcc/cp/decl.c  To
reproduce the bug you have to call the cc1plus compiler with exact command line
options.

A unpatched gcc 2.95 release compiler has to be called with

cc1plus -O2 -fPIC qmenubar.ii -quiet

to cause the bug. That is the standard behaviour when cc1plus is called be the
gcc frontend. Calling it without -quiet doesn't expose the bug.

a gcc from the current gcc 2.95 release branch behaves the other way round. You
have to call it without the quiet option:

cc1plus -O2 -fPIC qmenubar.ii

Compiling qmenubar.cpp with the frontent works well now but the bug is still in
there. (but the compiler doesn't crash because cc1plus is called with -quiet)


Here is a backtrace of cc1plus:

Program received signal SIGSEGV, Segmentation fault.
0x8294a16 in permanent_p (t=0x2b) at ../../../gcc/cp/tree.c:1998
1998	  return TREE_PERMANENT (t) ? t : NULL_TREE;
(gdb) bt
#0  0x8294a16 in permanent_p (t=0x2b) at ../../../gcc/cp/tree.c:1998
#1  0x8293df9 in mapcar (t=0x2b, func=0x8294a10 <permanent_p>)
    at ../../../gcc/cp/tree.c:1743
#2  0x8293f7f in mapcar (t=0x8322600, func=0x8294a10 <permanent_p>)
    at ../../../gcc/cp/tree.c:1789
#3  0x82942d6 in mapcar (t=0x8322458, func=0x8294a10 <permanent_p>)
    at ../../../gcc/cp/tree.c:1891
#4  0x82941c7 in mapcar (t=0x832243c, func=0x8294a10 <permanent_p>)
    at ../../../gcc/cp/tree.c:1836
#5  0x8294207 in mapcar (t=0x8322424, func=0x8294a10 <permanent_p>)
    at ../../../gcc/cp/tree.c:1877
#6  0x8281708 in build_new_1 (exp=0x83235e8) at ../../../gcc/cp/init.c:2467
#7  0x8221d9f in cplus_expand_expr (exp=0x83235e8, target=0x0, tmode=VOIDmode, 
    modifier=EXPAND_NORMAL) at ../../../gcc/cp/expr.c:247
#8  0x8094b4a in expand_expr (exp=0x83235e8, target=0x0, tmode=VOIDmode, 
    modifier=EXPAND_NORMAL) at ../../gcc/expr.c:8226
#9  0x8090fec in expand_expr (exp=0x8323618, target=0x0, tmode=SImode, 
    modifier=EXPAND_NORMAL) at ../../gcc/expr.c:6869
#10 0x808a85f in store_expr (exp=0x8323618, target=0x878666c, want_value=0)
    at ../../gcc/expr.c:3715
#11 0x808c99f in store_field (target=0x8786640, bitsize=32, bitpos=1184, 
    mode=SImode, exp=0x8323618, value_mode=VOIDmode, unsignedp=1, align=4, 
    total_size=152, alias_set=180) at ../../gcc/expr.c:4773
#12 0x8089fdc in expand_assignment (to=0x832322c, from=0x8323618, 
    want_value=0, suggest_reg=1) at ../../gcc/expr.c:3413
#13 0x8094134 in expand_expr (exp=0x832362c, target=0x0, tmode=VOIDmode, 
    modifier=EXPAND_NORMAL) at ../../gcc/expr.c:7949
#14 0x8079044 in expand_expr_stmt (exp=0x832362c) at ../../gcc/stmt.c:1669
#15 0x8220de2 in cplus_expand_expr_stmt (exp=0x832362c)
    at ../../../gcc/cp/decl.c:14855
#16 0x828ec90 in finish_expr_stmt (expr=0x832362c)
    at ../../../gcc/cp/semantics.c:82
#17 0x8262a32 in yyparse () at parse.y:3282
#18 0x804bb94 in compile_file (name=0xbffffa4f "qmenubar.ii")
    at ../../gcc/toplev.c:3265
#19 0x804f94b in main (argc=4, argv=0xbffff8d4) at ../../gcc/toplev.c:5441
#20 0x400325af in __libc_start_main (main=0x804e710 <main>, argc=4, 
    argv=0xbffff8d4, init=0x8048dd0 <_init>, fini=0x82987a0 <_fini>, 
    rtld_fini=0x4000adc0 <_dl_fini>, stack_end=0xbffff8cc)
    at ../sysdeps/generic/libc-start.c:78
(gdb) quit

It is very similar to the bug report of Daniel Jacobowitz so it is probably
caused by the same bug.

Greetings

Alexander

qmenubar.ii.gz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]