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

--- Comment #4 from Drea Pinski <pinskia at gcc dot gnu.org> ---
Looks like it is already handled in backprop:
backprop::process_builtin_call_use:
    CASE_CFN_COPYSIGN:
    CASE_CFN_COPYSIGN_FN:
      /* The sign of the first input is ignored.  */
      if (rhs != gimple_call_arg (call, 1))
        info->flags.ignore_sign = true;
      break;


strip_sign_op_1:
  else if (gcall *call = dyn_cast <gcall *> (def_stmt))
    switch (gimple_call_combined_fn (call))
      {
      CASE_CFN_COPYSIGN:
      CASE_CFN_COPYSIGN_FN:
        return gimple_call_arg (call, 0);

      default:
        break;
      }


Oh but this is a different this is about second operand.

We have a pattern for the first argument one too:
```
/* copysign(copysign(x, y), z) -> copysign(x, z).  */
(for copysigns (COPYSIGN_ALL)
 (simplify
  (copysigns (copysigns @0 @1) @2)
  (copysigns @0 @2)))
```

Reply via email to