[Bug tree-optimization/97623] [9/10/11 Regression] Extremely slow O2 compile (>>O(n^2))

tschwinge at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Nov 11 16:11:13 GMT 2020


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

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tschwinge at gcc dot gnu.org

--- Comment #18 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
Noting the following in case there's something unexpected there:

(In reply to CVS Commits from comment #17)
> commit r11-4913-gbd87cc14ebdb6789e067fb1828d5808407c308b3
> Author: Richard Biener <rguenther@suse.de>
> Date:   Wed Nov 11 11:51:59 2020 +0100
> 
>     tree-optimization/97623 - Avoid PRE hoist insertion iteration

On x84_64 GNU/Linux native, this introduced an ICE regression in
'libgomp/plugin/plugin-gcn.c' build (only! -- all other target libraries built
fine):

    during GIMPLE pass: pre
    [...]/libgomp/plugin/plugin-gcn.c: In function ‘run_kernel’:
    [...]/libgomp/plugin/plugin-gcn.c:2066:1: internal compiler error:
Segmentation fault
     2066 | run_kernel (struct kernel_info *kernel, void *vars,
          | ^~~~~~~~~~

    Program received signal SIGSEGV, Segmentation fault.
    bitmap_bit_p (head=0x20, bit=879) at [...]/gcc/bitmap.c:989
    989       if (!head->tree_form)
    (gdb) bt
    #0  bitmap_bit_p (head=0x20, bit=879) at [...]/gcc/bitmap.c:989
    #1  0x0000000001057bb3 in bitmap_set_contains_value (value_id=879, set=0x0)
at [...]/gcc/tree-ssa-pre.c:899
    #2  bitmap_value_replace_in_set (set=0x0, expr=expr@entry=0x2d7f990) at
[...]/gcc/tree-ssa-pre.c:920
    #3  0x0000000001057f35 in create_expression_by_pieces
(block=block@entry=0x7ffff63a51a0, expr=expr@entry=0x2d798f0,
stmts=stmts@entry=0x7fffffffc440, type=<optimized out>) at
[...]/gcc/tree-ssa-pre.c:3003
    #4  0x000000000105e3e9 in do_hoist_insertion (block=<optimized out>) at
[...]/gcc/tree-ssa-pre.c:3648
    #5  insert () at [...]/gcc/tree-ssa-pre.c:3764
    #6  (anonymous namespace)::pass_pre::execute (this=<optimized out>,
fun=0x7ffff6221da8) at [...]/gcc/tree-ssa-pre.c:4299
    #7  0x0000000000d50820 in execute_one_pass (pass=pass@entry=0x2c132f0) at
[...]/gcc/passes.c:2564
    #8  0x0000000000d51198 in execute_pass_list_1 (pass=0x2c132f0) at
[...]/gcc/passes.c:2653
    #9  0x0000000000d511aa in execute_pass_list_1 (pass=0x2c12220) at
[...]/gcc/passes.c:2654
    #10 0x0000000000d511f5 in execute_pass_list (fn=<optimized out>,
pass=<optimized out>) at [...]/gcc/passes.c:2664
    #11 0x000000000094ae6d in cgraph_node::expand (this=0x7ffff6220dd0) at
[...]/gcc/cgraphunit.c:1829
    #12 0x000000000094c69d in expand_all_functions () at
[...]/gcc/cgraphunit.c:1997
    #13 symbol_table::compile (this=this@entry=0x7ffff67a8100) at
[...]/gcc/cgraphunit.c:2361
    #14 0x000000000094fdde in symbol_table::compile (this=0x7ffff67a8100) at
[...]/gcc/cgraphunit.c:2274
    #15 symbol_table::finalize_compilation_unit (this=0x7ffff67a8100) at
[...]/gcc/cgraphunit.c:2542
    #16 0x0000000000e866b1 in compile_file () at [...]/gcc/toplev.c:485
    #17 0x0000000000742f4c in do_compile () at [...]/gcc/toplev.c:2320
    #18 toplev::main (this=this@entry=0x7fffffffc6e0, argc=argc@entry=62,
argv=argv@entry=0x7fffffffc7e8) at [...]/gcc/toplev.c:2459
    #19 0x0000000000746f87 in main (argc=62, argv=0x7fffffffc7e8) at
[...]/gcc/main.c:39

I find this ICE is then again cured by your follow-on commit
r11-4921-g86cca5cc14602814b98e55aae313fbe237af1b04 "Fix PRE topological
expression set sorting", but I can't easily tell if that's now all
fine/expected, or if there may be some underlying problem here, which makes the
ICE just hidden again?  If relevant, please tell if you'd like me to attach a
pre-processed source file.


More information about the Gcc-bugs mailing list