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

--- Comment #57 from Jeffrey A. Law <law at redhat dot com> ---
Below is a POC for improving the uninit analysis to handle this kind of case. 
It's not complete.  In particular it does not ensure that the we have the same
result on the RHS and LHS of the V_C_E.  Basically I'm just showing where/how
we could look through a V_C_E to determine that the use is properly guarded.

+      /* If FLAG_DEF is a V_C_E, then we can look through it.
+        The trick is to know when the V_C_E doesn't change the
+        value, which isn't validated yet.  */
+      if (is_gimple_assign (*flag_def)
+         && gimple_assign_rhs_code (*flag_def) == VIEW_CONVERT_EXPR)
+       {
+         tree rhs = gimple_assign_rhs1 (*flag_def);
+         rhs = TREE_OPERAND (rhs, 0);
+         if (TREE_CODE (rhs) == SSA_NAME)
+           {
+             if ((*flag_def = SSA_NAME_DEF_STMT (rhs)) == NULL)
+               continue;
+           }
+       }

Reply via email to