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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |tree-optimization

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I will finish this up tomorrow but here is the patch which I will doing (note
white spaces might be wrong):
```
diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
index 770f3629fe1..be95798a065 100644
--- a/gcc/tree-ssa-phiopt.cc
+++ b/gcc/tree-ssa-phiopt.cc
@@ -368,6 +368,10 @@ factor_out_conditional_operation (edge e0, edge e1, gphi
*phi,
   if (!types_compatible_p (TREE_TYPE (new_arg0), TREE_TYPE (new_arg1)))
     return NULL;

+  /* The new args need to be both gimple values. */
+  if (!is_gimple_val (new_arg0) || !is_gimple_val (new_arg1))
+    return NULL;
+
   /* Function calls can only be const or an internal function
      as maybe_push_res_to_seq only handles those currently.  */
   if (!arg0_op.code.is_tree_code ())

```

Reply via email to