[Bug rtl-optimization/105577] [12/13 Regression] ICE in delete_unmarked_insns, at dce.cc:653 since r12-248-gb58dc0b803057c0e

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu May 12 11:53:29 GMT 2022


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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #7)
> (In reply to Martin Liška from comment #6)
> > With -fdelete-dead-exceptions, it started with r12-248-gb58dc0b803057c0e.
> > The reduction is pretty slow..
> 
> That just exposed the issue I think since the failure is at the rtl level
> while that change effects things way before in gimple.

So the insn removed that triggers the must_clean is

(insn/v 27 23 30 3 (set (reg:V2DI 107)
        (const_vector:V2DI [
                (const_int 0 [0]) repeated x2
            ])) "/usr/local/include/c++/12.1.0/bits/shared_ptr_base.h":1463:9
1700 {movv2di_internal}
     (nil))

we first remove that and then call purge_dead_edges which then runs into
the newly(!) last insn:

(call_insn 23 22 30 3 (set (reg:DI 0 ax)
        (call (mem:QI (symbol_ref:DI ("memset") [flags 0x41] <function_decl
0x7ffff65ebc00 __builtin_memset>) [0 __builtin_memset S1 A8])
            (const_int 0 [0])))
"../../thirdparty/rocksdb-cloud/db/job_context.h":49:29 909 {*call_value}
     (expr_list:REG_DEAD (reg:DI 5 di)
        (expr_list:REG_DEAD (reg:SI 4 si)
            (expr_list:REG_DEAD (reg:DI 1 dx)
                (expr_list:REG_UNUSED (reg:DI 0 ax)
                    (expr_list:REG_CALL_DECL (symbol_ref:DI ("memset") [flags
0x41] <function_decl 0x7ffff65ebc00 __builtin_memset>)
                        (expr_list:REG_EH_REGION (const_int 0 [0])
                            (nil)))))))
    (expr_list:DI (set (reg:DI 0 ax)
            (reg:DI 5 di))
        (expr_list:DI (use (reg:DI 5 di))
            (expr_list:SI (use (reg:SI 4 si))
                (expr_list:DI (use (reg:DI 1 dx))
                    (nil))))))

which cannot throw.  But we still have an EH edge out of this block which
is the real issue here.  Somebody forgot to clean the EH edge earlier.
In fact before DSE we have

(insn 27 23 28 3 (set (reg:V2DI 107)
        (const_vector:V2DI [
                (const_int 0 [0]) repeated x2
            ])) "/usr/local/include/c++/12.1.0/bits/shared_ptr_base.h":1463:9
1700 {movv2di_internal}
     (nil))
(insn 28 27 29 3 (set (mem:V2DI (plus:DI (reg/f:DI 94 [ _34 ])
                (const_int 96 [0x60])) [0 MEM <vector(2) long unsigned int>
[(void *)_34 + 96B]+0 S16 A64])
        (reg:V2DI 107))
"/usr/local/include/c++/12.1.0/bits/shared_ptr_base.h":1463:9 1700
{movv2di_internal}
     (expr_list:REG_DEAD (reg:V2DI 107)
        (expr_list:REG_EH_REGION (const_int -15 [0xfffffffffffffff1])
            (nil))))
(insn 29 28 30 3 (set (mem:QI (plus:DI (reg/f:DI 94 [ _34 ])
                (const_int 112 [0x70])) [26 MEM[(struct MutableCFOptions *)_34
+ 32B].disable_auto_compactions+0 S1 A64])
        (const_int 0 [0]))
"../../thirdparty/rocksdb-cloud/options/cf_options.h":173:9 83
{*movqi_internal}
     (expr_list:REG_EH_REGION (const_int 3 [0x3])
        (nil)))
;;  succ:       4 [always]  count:1459806 (estimated locally) (FALLTHRU)
;;              49 [never]  count:0 (precise) (ABNORMAL,EH)

so DSE removes insn 28 and insn 29 but forgets to clean EH.


More information about the Gcc-bugs mailing list