On Mon, Dec 05, 2016 at 11:32:15PM +0530, Prathamesh Kulkarni wrote: > So I had to check if SSA_NAME_DEF_STMT (rhs2) was call to strstr > rather than rhs1.
Then you need to test both whether it is strstr (s, t) == s or s == strstr (s, t). > + gassign *ga = gimple_build_assign (lhs, code, > + strcmp_lhs, zero); The formatting is wrong here. > + gsi_replace (&gsi, ga, false); > + } > + } > + } > + } > + } > + } > else if (TREE_CODE (lhs) != SSA_NAME && !TREE_SIDE_EFFECTS (lhs)) > { > tree type = TREE_TYPE (lhs); > @@ -2505,7 +2554,7 @@ const pass_data pass_data_strlen = > 0, /* properties_provided */ > 0, /* properties_destroyed */ > 0, /* todo_flags_start */ > - 0, /* todo_flags_finish */ > + TODO_update_ssa, /* todo_flags_finish */ No, please don't. Just make sure to build proper SSA right away. Jakub