Simplify abs (copysign (x, y))
commitf7d7e26f10e8e329c3521ae7475ed2dfa38ba677
authorRichard Biener <rguenther@suse.de>
Wed, 27 Sep 2023 10:48:50 +0000 (27 12:48 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 27 Sep 2023 11:45:20 +0000 (27 13:45 +0200)
treecee5158efbdbb37229c13ab13972d8c23dafafd2
parentd326bb6d7588425d013791299272f913fb23e56d
Simplify abs (copysign (x, y))

The following adds simplification of abs (copysign (x, y)) to abs (x).

* match.pd (abs (copysign (x, y)) -> abs (x)): New pattern.

* gcc.dg/fold-abs-6.c: New testcase.
gcc/match.pd
gcc/testsuite/gcc.dg/fold-abs-6.c [new file with mode: 0644]