Bug 51493 - [4.7 regression] ICE when compiling scummvm with -O2 and any graphite optimization
Summary: [4.7 regression] ICE when compiling scummvm with -O2 and any graphite optimiz...
Status: RESOLVED DUPLICATE of bug 50913
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.7.0
: P3 major
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-10 03:18 UTC by Matt Hargett
Modified: 2011-12-12 10:16 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
pre-processed source of the file that triggers the ICE when compiled with -O2 -floop-block (37.16 KB, application/x-bzip)
2011-12-10 03:24 UTC, Matt Hargett
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Hargett 2011-12-10 03:18:14 UTC
With trunk as of 2011-12-09, on Ubuntu 11.10/amd64.

I was able to reproduce what *appears to be* the issue on the individual file (pre-processed source attached), but only with a specific set of configure flags to scummvm. An alternate testcase involving LTO is also here, which I can split out to a separate bug if need be.

$ g++ -O2 -floop-block res_ami.i
engines/agos/res_ami.cpp: In member function ‘byte* AGOS::AGOSEngine::convertImage(AGOS::VC10_state*, bool)’:
engines/agos/res_ami.cpp:143:7: internal compiler error: in scan_tree_for_params_right_scev, at graphite-sese-to-poly.c:633

Note that pretty much any loop-based flag will trigger the issue. Only using -O2, or using -O1 with -floop-* works around the crash. When running the above test case under valgrind, I see:
==21219== Conditional jump or move depends on uninitialised value(s)
==21219==    at 0xD02445: refs_may_alias_p_1(ao_ref_s*, ao_ref_s*, bool) (tree-ssa-alias.c:1027)
==21219==    by 0xA92139: stmt_may_clobber_ref_p_1(gimple_statement_d*, ao_ref_s*) (tree-ssa-alias.c:1762)
==21219==    by 0xA92210: _ZL20walk_aliased_vdefs_1P8ao_ref_sP9tree_nodePFbS0_S2_PvES3_PP15bitmap_head_defj.955263.constprop.2845.16875 (tree-ssa-alias.c:2158)
==21219==    by 0xA9238D: walk_aliased_vdefs(ao_ref_s*, tree_node*, bool (*)(ao_ref_s*, tree_node*, void*), void*, bitmap_head_def**) (tree-ssa-alias.c:2178)
==21219==    by 0xA9335E: _ZL20detect_type_change_1P9tree_nodeS0_S0_P18gimple_statement_dP13ipa_jump_funcl.498561.15992 (ipa-prop.c:460)
==21219==    by 0xA9634B: ipa_analyze_node(cgraph_node*) (ipa-prop.c:1505)
==21219==    by 0xA96F88: _ZL21ipcp_generate_summaryv.1445752 (ipa-cp.c:2490)
==21219==    by 0xE3AF25: execute_ipa_summary_passes(ipa_opt_pass_d*) (passes.c:1888)
==21219==    by 0x9912C6: cgraph_optimize() (cgraphunit.c:2059)
==21219==    by 0x991559: cgraph_finalize_compilation_unit() (cgraphunit.c:1327)
==21219==    by 0xCE3EBA: cp_write_global_declarations() (decl2.c:4050)
==21219==    by 0xC8DA2F: toplev_main(int, char**) (toplev.c:573)
==21219==  Uninitialised value was created by a stack allocation
==21219==    at 0xA934ED: _ZL22detect_type_change_ssaP9tree_nodeP18gimple_statement_dP13ipa_jump_func.498569.15987 (ipa-prop.c:511)



The ICE is on any graphite-related flag and has potentally related valgrind output; Otherwise, I would think this is a regression of PR42930 (which it may actually be).

to reproduce with LTO:
-get latest scummvm sources, unpack and cd into the dir
-CXX=/path/to/gcc-trunk/bin/g++ CXXFLAGS="-O2 -flto -floop-block" LDFLAGS="-O2 -flto -floop-block" ./configure --disable-all-engines --enable-agos

-make
-during final link

result:
In file included from :422:0:
engines/agos/res_ami.cpp: In member function ‘convertImage’:
engines/agos/res_ami.cpp:143:0: internal compiler error: in scan_tree_for_params_right_scev, at graphite-sese-to-poly.c:633

NOTE: looks like the fully qualified class name gets clobbered during LTO :( I'll file in a separate bug.
Comment 1 Matt Hargett 2011-12-10 03:24:45 UTC
Created attachment 26039 [details]
pre-processed source of the file that triggers the ICE when compiled with -O2 -floop-block
Comment 2 Richard Biener 2011-12-12 10:16:31 UTC
dup.

*** This bug has been marked as a duplicate of bug 50913 ***