Bug 802731

Summary: g++ ICE when compiling qt with -O2
Product: [Fedora] Fedora Reporter: Karsten Hopp <karsten>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: high    
Version: 17CC: bergner, jakub, law
Target Milestone: ---   
Target Release: ---   
Hardware: ppc   
OS: Linux   
Whiteboard:
Fixed In Version: gcc-4.7.0-0.20.fc17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-21 19:07:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
preprocessed source none

Description Karsten Hopp 2012-03-13 11:10:48 UTC
Created attachment 569641 [details]
preprocessed source

Description of problem:
QT builds on PPC (32bit) abort with an internal compiler error.
I'll attach preprocessed sources.

Version-Release number of selected component (if applicable):
gcc-4.7.0-0.19.fc17.ppc

How reproducible:
always

Steps to Reproduce:
1. in a chroot with the latest f17 ppc packages, run
g++ -c -pipe -Wall -Wreturn-type -fno-strict-aliasing -Wcast-align -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit-self -fno-stack-protector -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -O2 -fvisibility=hidden -fvisibility-inlines-hidden -D_REENTRANT -fPIC -DQT_SHARED -DJSC=QTJSC -Djscyyparse=qtjscyyparse -Djscyylex=qtjscyylex -Djscyyerror=qtjscyyerror -DWTF=QTWTF -DQT_BUILD_SCRIPT_LIB -DQT_NO_USING_NAMESPACE -DQLALR_NO_QSCRIPTGRAMMAR_DEBUG_INFO -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DBUILDING_QT__=1 -DWTF_USE_ACCELERATED_COMPOSITING -DNDEBUG -DBUILDING_QT__ -DBUILDING_JavaScriptCore -DBUILDING_WTF -DWTF_USE_JAVASCRIPTCORE_BINDINGS=1 -DWTF_CHANGES=1 -DNDEBUG -DJS_NO_EXPORT -DQT_NO_DEBUG -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -o JSGlobalData.o ICE.i
2.
3.
  
Actual results:
ICE

Expected results:


Additional info:

Comment 2 Peter Bergner 2012-03-13 15:57:35 UTC
We get a SEGV for trying to dereference a null pointer.  I'm seeing this on FSF trunk, so we should probably open a FSF bugzilla too.  I'll check whether we SEGV on FSF 4.7 branch too.  I'm guess we do.

Program received signal SIGSEGV, Segmentation fault.
0x00000000106b6d08 in cgraph_only_called_directly_or_aliased_p (node=0x0) at /home/bergner/gcc/gcc-mainline-debug/gcc/cgraph.h:935
935	  gcc_assert (!node->global.inlined_to);
(gdb) bt
#0  0x00000000106b6d08 in cgraph_only_called_directly_or_aliased_p (node=0x0) at /home/bergner/gcc/gcc-mainline-debug/gcc/cgraph.h:935
#1  0x00000000106c2744 in cgraph_not_only_called_directly_p_1 (node=0x0, data=0x0)
    at /home/bergner/gcc/gcc-mainline-debug/gcc/cgraph.c:3014
#2  0x00000000106c0b8c in cgraph_for_node_and_aliases (node=0x0, callback=@0x119dd758: 0x106c2720 <cgraph_not_only_called_directly_p_1>, 
    data=0x0, include_overwritable=1 '\001') at /home/bergner/gcc/gcc-mainline-debug/gcc/cgraph.c:2612
#3  0x00000000106c27e4 in cgraph_only_called_directly_p (node=0x0) at /home/bergner/gcc/gcc-mainline-debug/gcc/cgraph.c:3026
#4  0x000000001117b464 in call_ABI_of_interest (fndecl=0xfffa3189c00)
    at /home/bergner/gcc/gcc-mainline-debug/gcc/config/rs6000/rs6000.c:7455
#5  0x000000001117b918 in init_cumulative_args (cum=0xfffffffc6b8, fntype=0xfffab130540, libname=0x0, incoming=0, libcall=0, 
    n_named_args=2, fndecl=0xfffa3189c00, return_mode=VOIDmode) at /home/bergner/gcc/gcc-mainline-debug/gcc/config/rs6000/rs6000.c:7518
#6  0x000000001065b318 in expand_call (exp=0xfffa4a46fc0, target=0x0, ignore=1) at /home/bergner/gcc/gcc-mainline-debug/gcc/calls.c:2475
#7  0x0000000010828f3c in expand_expr_real_1 (exp=0xfffa4a46fc0, target=0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0)
    at /home/bergner/gcc/gcc-mainline-debug/gcc/expr.c:10022
#8  0x00000000106808ac in expand_call_stmt (stmt=0xfffa3472200) at /home/bergner/gcc/gcc-mainline-debug/gcc/cfgexpand.c:2077
#9  0x0000000010680a7c in expand_gimple_stmt_1 (stmt=0xfffa3472200) at /home/bergner/gcc/gcc-mainline-debug/gcc/cfgexpand.c:2116
#10 0x0000000010681378 in expand_gimple_stmt (stmt=0xfffa3472200) at /home/bergner/gcc/gcc-mainline-debug/gcc/cfgexpand.c:2268
#11 0x000000001068c648 in expand_gimple_basic_block (bb=0xfffa49d50d8) at /home/bergner/gcc/gcc-mainline-debug/gcc/cfgexpand.c:4017
#12 0x000000001068ed90 in gimple_expand_cfg () at /home/bergner/gcc/gcc-mainline-debug/gcc/cfgexpand.c:4527
#13 0x0000000010b856ac in execute_one_pass (pass=0x119b2448) at /home/bergner/gcc/gcc-mainline-debug/gcc/passes.c:2084
#14 0x0000000010b859b4 in execute_pass_list (pass=0x119b2448) at /home/bergner/gcc/gcc-mainline-debug/gcc/passes.c:2139
#15 0x0000000010ddf2c8 in tree_rest_of_compilation (fndecl=0xfffa6dc2300) at /home/bergner/gcc/gcc-mainline-debug/gcc/tree-optimize.c:422
#16 0x00000000106cf534 in cgraph_expand_function (node=0xfffa33605a0) at /home/bergner/gcc/gcc-mainline-debug/gcc/cgraphunit.c:1837
#17 0x00000000106cf818 in cgraph_expand_all_functions () at /home/bergner/gcc/gcc-mainline-debug/gcc/cgraphunit.c:1904
#18 0x00000000106d0954 in cgraph_optimize () at /home/bergner/gcc/gcc-mainline-debug/gcc/cgraphunit.c:2218
#19 0x00000000106ccf78 in cgraph_finalize_compilation_unit () at /home/bergner/gcc/gcc-mainline-debug/gcc/cgraphunit.c:1344
#20 0x00000000102b44c0 in cp_write_global_declarations () at /home/bergner/gcc/gcc-mainline-debug/gcc/cp/decl2.c:4074
#21 0x0000000010cefe6c in compile_file () at /home/bergner/gcc/gcc-mainline-debug/gcc/toplev.c:573
#22 0x0000000010cf3bac in do_compile () at /home/bergner/gcc/gcc-mainline-debug/gcc/toplev.c:1937
#23 0x0000000010cf3e3c in toplev_main (argc=35, argv=0xfffffffed78) at /home/bergner/gcc/gcc-mainline-debug/gcc/toplev.c:2013
#24 0x00000000105b942c in main (argc=35, argv=0xfffffffed78) at /home/bergner/gcc/gcc-mainline-debug/gcc/main.c:36

I don't know the tree level that well, but for some reason, in rs6000.c:call_ABI_of_interest(), the call to:

      /* Interesting functions that we are emitting in this object file.  */
      c_node = cgraph_get_node (fndecl);

returns null and we don't recover.

The fndecl looks like:

(gdb) ptree fndecl
 <function_decl 0xfffa3189c00 __comp_dtor 
    type <method_type 0xfffa317e070
        type <void_type 0xfffb5e40bd0 void asm_written type_6 VOID
            align 8 symtab 0 alias set -1 canonical type 0xfffb5e40bd0
            pointer_to_this <pointer_type 0xfffb5e40c78>>
        SI
        size <integer_cst 0xfffb5d52440 constant 32>
        unit size <integer_cst 0xfffb5d52460 constant 4>
        align 32 symtab 0 alias set -1 canonical type 0xfffa317e070 method basetype <record_type 0xfffa3178730 JSByteArray>
        arg-types <tree_list 0xfffa31a4010 value <pointer_type 0xfffa31789d0>
            chain <tree_list 0xfffb5dc13b0 value <void_type 0xfffb5e40bd0 void>>>
        pointer_to_this <pointer_type 0xfffa317e460>>
    addressable public autoinline virtual SI file ICE.ii line 39894 col 11 align 32 context <record_type 0xfffa3178730 JSByteArray> abstract_origin <function_decl 0xfffa3189a00 JSByteArray>
    arguments <parm_decl 0xfffa31b20f0 this
        type <pointer_type 0xfffa3178a78 type <record_type 0xfffa3178730 JSByteArray>
            readonly unsigned SI size <integer_cst 0xfffb5d52440 32> unit size <integer_cst 0xfffb5d52460 4>
            align 32 symtab 4095 alias set -1 canonical type 0xfffa3178a78>
        readonly unsigned SI file ICE.ii line 39894 col 11 size <integer_cst 0xfffb5d52440 32> unit size <integer_cst 0xfffb5d52460 4>
        align 32 context <function_decl 0xfffa3189c00 __comp_dtor > arg-type <pointer_type 0xfffa3178a78>>
    full-name "virtual QTJSC::JSByteArray::~JSByteArray()"
    chain <function_decl 0xfffa3189b00 __deleting_dtor >>

Comment 3 Peter Bergner 2012-03-13 16:20:17 UTC
Same SEGV at the same location with FSF 4.7.

Comment 4 Karsten Hopp 2012-03-13 18:02:00 UTC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582

Comment 5 Fedora Update System 2012-03-16 20:58:25 UTC
gcc-4.7.0-0.20.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/gcc-4.7.0-0.20.fc17

Comment 6 Fedora Update System 2012-03-17 16:50:23 UTC
Package gcc-4.7.0-0.20.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gcc-4.7.0-0.20.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-3967/gcc-4.7.0-0.20.fc17
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2012-03-21 19:07:12 UTC
gcc-4.7.0-0.20.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.