On Wed, Jun 17, 2020 at 4:11 AM Shuai Wang via Gcc <gcc@gcc.gnu.org> wrote: > > Hello, > > Suppose I have changed certain if condition in the GIMPLE code (generated > by the `sanopt` pass) into the following format: > > if (0 == 1) > { > xxxx > } > > Then, in order to completely remove this unnecessary if condition and the > guarded true branch, I want to leverage the dead code elimination > optimization of gcc. However, I just cannot figure out a way of doing so. I > use the following command to output the instrumented GIMPLE code:
A simple CFG cleanup would get rid of the above, if you insert a pass make sure to return TODO_cfg_cleanup from it. > gcc -fdump-tree-all -fplugin=./instrumentor.so -g -fsanitize=address test.c > > And notice that the instrumented gimple code is right there in the > outputs: test.c.322t.instrumentor. Everything seems fine. > > Anyone could shed some light on how to re-optimize (e.g., with deadcode > elimination or just use -O3 if possible) the instrumented GIMPLE code? > Thank you very much. > > Shuai