[Bug rtl-optimization/48188] ICE: SIGSEGV in remove_unnecessary_regions (ira-build.c:1855) with --param ira-max-loops-num=0 on basic code

zsojka at seznam dot cz gcc-bugzilla@gcc.gnu.org
Tue Mar 3 19:46:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48188

Zdenek Sojka <zsojka at seznam dot cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-pc-linux-gnu
               Host|                            |x86_64-pc-linux-gnu
      Known to fail|                            |4.8.5, 4.9.3, 5.0

--- Comment #3 from Zdenek Sojka <zsojka at seznam dot cz> ---
Still crashes in trunk. At least -O2 is needed now; or -O1 with valgrind.

$ gcc -O2 --param ira-max-loops-num=0 testcase.c 
testcase.c: In function 'foo':
testcase.c:1:1: internal compiler error: Segmentation fault
 void foo (void) { }
 ^
0xc4a2ff crash_signal
        /mnt/svn/gcc-trunk/gcc/toplev.c:383
0xa81521 mark_loops_for_removal
        /mnt/svn/gcc-trunk/gcc/ira-build.c:2296
0xa81521 remove_unnecessary_regions
        /mnt/svn/gcc-trunk/gcc/ira-build.c:2635
0xa84122 ira_build()
        /mnt/svn/gcc-trunk/gcc/ira-build.c:3462
0xa7bcb4 ira
        /mnt/svn/gcc-trunk/gcc/ira.c:5254
0xa7bcb4 execute
        /mnt/svn/gcc-trunk/gcc/ira.c:5546
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

gcc -O --param ira-max-loops-num=0 testcase.c -wrapper valgrind,-q
==9427== Use of uninitialised value of size 8
==9427==    at 0xA81521: mark_loops_for_removal (ira-build.c:2296)
==9427==    by 0xA81521: remove_unnecessary_regions(bool) (ira-build.c:2635)
==9427==    by 0xA84122: ira_build() (ira-build.c:3462)
==9427==    by 0xA7BCB4: ira (ira.c:5254)
==9427==    by 0xA7BCB4: (anonymous namespace)::pass_ira::execute(function*)
(ira.c:5546)
==9427==    by 0xB53C7E: execute_one_pass(opt_pass*) (passes.c:2328)
==9427==    by 0xB540F5: execute_pass_list_1(opt_pass*) [clone .constprop.73]
(passes.c:2380)
==9427==    by 0xB54107: execute_pass_list_1(opt_pass*) [clone .constprop.73]
(passes.c:2381)
==9427==    by 0xB54148: execute_pass_list(function*, opt_pass*)
(passes.c:2391)
==9427==    by 0x8365FB: cgraph_node::expand() (cgraphunit.c:1878)
==9427==    by 0x837CE8: expand_all_functions (cgraphunit.c:2014)
==9427==    by 0x837CE8: symbol_table::compile() [clone .part.55]
(cgraphunit.c:2367)
==9427==    by 0x839C3F: compile (timevar.h:110)
==9427==    by 0x839C3F: symbol_table::finalize_compilation_unit()
(cgraphunit.c:2444)
==9427==    by 0x6D5A6A: c_write_global_declarations() (c-decl.c:10803)
==9427==    by 0xC4A383: compile_file() (toplev.c:608)
==9427== 
==9427== Invalid write of size 1
==9427==    at 0xA81521: mark_loops_for_removal (ira-build.c:2296)
==9427==    by 0xA81521: remove_unnecessary_regions(bool) (ira-build.c:2635)
==9427==    by 0xA84122: ira_build() (ira-build.c:3462)
==9427==    by 0xA7BCB4: ira (ira.c:5254)
==9427==    by 0xA7BCB4: (anonymous namespace)::pass_ira::execute(function*)
(ira.c:5546)
==9427==    by 0xB53C7E: execute_one_pass(opt_pass*) (passes.c:2328)
==9427==    by 0xB540F5: execute_pass_list_1(opt_pass*) [clone .constprop.73]
(passes.c:2380)
==9427==    by 0xB54107: execute_pass_list_1(opt_pass*) [clone .constprop.73]
(passes.c:2381)
==9427==    by 0xB54148: execute_pass_list(function*, opt_pass*)
(passes.c:2391)
==9427==    by 0x8365FB: cgraph_node::expand() (cgraphunit.c:1878)
==9427==    by 0x837CE8: expand_all_functions (cgraphunit.c:2014)
==9427==    by 0x837CE8: symbol_table::compile() [clone .part.55]
(cgraphunit.c:2367)
==9427==    by 0x839C3F: compile (timevar.h:110)
==9427==    by 0x839C3F: symbol_table::finalize_compilation_unit()
(cgraphunit.c:2444)
==9427==    by 0x6D5A6A: c_write_global_declarations() (c-decl.c:10803)
==9427==    by 0xC4A383: compile_file() (toplev.c:608)
==9427==  Address 0x40 is not stack'd, malloc'd or (recently) free'd
==9427== 
testcase.c: In function 'foo':
testcase.c:1:1: internal compiler error: Segmentation fault
 void foo (void) { }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
(In reply to Zdenek Sojka from comment #0)
> ----- testcase.c -----
> void foo (void) { }
> ----------------------
> 
> Compiler output:
> $ gcc --param ira-max-loops-num=0 testcase.c
> ==13273== Use of uninitialised value of size 8
> ==13273==    at 0x792776: remove_unnecessary_regions (ira-build.c:1855)
> ==13273==    by 0x794213: ira_build (ira-build.c:2994)
> ==13273==    by 0x78D4DE: ira (ira.c:3175)
> ==13273==    by 0x78F51F: rest_of_handle_ira (ira.c:3344)
> ==13273==    by 0x7F9C45: execute_one_pass (passes.c:1556)
> ==13273==    by 0x7F9F34: execute_pass_list (passes.c:1611)
> ==13273==    by 0x7F9F46: execute_pass_list (passes.c:1612)
> ==13273==    by 0x93E3F5: tree_rest_of_compilation (tree-optimize.c:422)
> ==13273==    by 0xB0E3E1: cgraph_expand_function (cgraphunit.c:1576)
> ==13273==    by 0xB10E2C: cgraph_optimize (cgraphunit.c:1733)
> ==13273==    by 0xB110B9: cgraph_finalize_compilation_unit
> (cgraphunit.c:1096)
> ==13273==    by 0x509113: c_write_global_declarations (c-decl.c:9872)
> ==13273==  Uninitialised value was created by a heap allocation
> ==13273==    at 0x4C26F30: malloc (in
> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==13273==    by 0x10BD427: xmalloc (xmalloc.c:147)
> ==13273==    by 0x79264C: remove_unnecessary_regions (ira-build.c:1835)
> ==13273==    by 0x794213: ira_build (ira-build.c:2994)
> ==13273==    by 0x78D4DE: ira (ira.c:3175)
> ==13273==    by 0x78F51F: rest_of_handle_ira (ira.c:3344)
> ==13273==    by 0x7F9C45: execute_one_pass (passes.c:1556)
> ==13273==    by 0x7F9F34: execute_pass_list (passes.c:1611)
> ==13273==    by 0x7F9F46: execute_pass_list (passes.c:1612)
> ==13273==    by 0x93E3F5: tree_rest_of_compilation (tree-optimize.c:422)
> ==13273==    by 0xB0E3E1: cgraph_expand_function (cgraphunit.c:1576)
> ==13273==    by 0xB10E2C: cgraph_optimize (cgraphunit.c:1733)
> ==13273== 
> ==13273== Invalid write of size 1
> ==13273==    at 0x792776: remove_unnecessary_regions (ira-build.c:1855)
> ==13273==    by 0x794213: ira_build (ira-build.c:2994)
> ==13273==    by 0x78D4DE: ira (ira.c:3175)
> ==13273==    by 0x78F51F: rest_of_handle_ira (ira.c:3344)
> ==13273==    by 0x7F9C45: execute_one_pass (passes.c:1556)
> ==13273==    by 0x7F9F34: execute_pass_list (passes.c:1611)
> ==13273==    by 0x7F9F46: execute_pass_list (passes.c:1612)
> ==13273==    by 0x93E3F5: tree_rest_of_compilation (tree-optimize.c:422)
> ==13273==    by 0xB0E3E1: cgraph_expand_function (cgraphunit.c:1576)
> ==13273==    by 0xB10E2C: cgraph_optimize (cgraphunit.c:1733)
> ==13273==    by 0xB110B9: cgraph_finalize_compilation_unit
> (cgraphunit.c:1096)
> ==13273==    by 0x509113: c_write_global_declarations (c-decl.c:9872)
> ==13273==  Address 0x3c is not stack'd, malloc'd or (recently) free'd
> ==13273== 
> testcase.c: In function 'foo':
> testcase.c:1:1: internal compiler error: Segmentation fault
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.



More information about the Gcc-bugs mailing list