Crash in remove_stmt_from_en_lp_fn() due to remving of gimple statement using gsi_remove
Shubham Narlawar
gsocshubham@gmail.com
Sat Nov 16 05:58:00 GMT 2019
Hello,
I'm writing a Simple LTO pass. I have placed my optimization routine under
execute() hook. In my optimization routine, I want to delete an
instruction for which I have the gimple_stmt_iterator. If I call
gsi_remove(gsi, true), it causes a crash in remove_stmt_from_en_lp_fn()
where it is expecting cfun and cfun is NULL.
If I call gsi_remove(gsi, false), it goes through fine but at final link
stage it shows undefined reference to a certain function. It looks like
the entire function vanished. And the instruction I tried to delete was
not even a part of that function.
Do I need to call update_ssa() after I delete the instruction using
gsi_remove(gsi, false)?
Is there a simple manner in which I can delete the instruction without
having to go through writing the full blown LTO pass with
serializers/deserializers and the like?
Thanks
Shubham
More information about the Gcc
mailing list