[Bug tree-optimization/126689] Missed removal of nested copysigns

"pinskia at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
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)))
```
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.